putting a line in a filename (with sed)

"How can I cut a line from a file and paste the rest into a file whose title is the line I just cut?"

If you find yourself asking yourself this question with any degree of regularity, you may have issues. Luckily for you, the help you so desperately need is at hand. It is not the help you want, but it is the help you deserve. For added complication let's assume you want to do this for every line in the file.

Solution (bash):

    > for i in $(seq `wc -l < FILENAME`)
    > do
    >   sed ''$i'd' FILENAME > something_else_maybe-`sed -n ''$i'p' FILENAME`
    > done

What is going on here is the following: