I was wondering if anybody could recommend a program or plug-in (for an editor) to solve the following problem: I have a file with a large list (one line per item). I need to manually go through this list and pick out which items (ie. lines) to keep. Then I would save these lines to a new file.

Usually, I would just fire-up some suitable editor and put an asterisk at the beginning of the lines I want to keep, then use sed to select these lines (and remove the asterisk) and redirect it to a file. But this time there are so many lines it would become cumbersome.

I was therefor wondering if anybody knows of a program/plug-in that would do something along these lines: A GUI "editor" that add a check-box in the front of each line, and where only the lines that are checked will be subsequently saved to a new file.

Bonus (not applicable to this problem, but may be handy another time): Tri-state or coloured check-boxes, allowing lines marked with different mark/colours to be saved in different files.

  • Suggestion: use the kill line feature of your preferred editor to remove the lines you don't want? C-k in nano, or dd in vi – Panki Mar 27 at 10:40
  • 1
    @Panki Unfortunately, the number of lines I'll ignore greatly outnumber the lines I'll keep, so killing lines would be cumbersome. – Baard Kopperud Mar 27 at 11:10

I don't get why you can't work with your previous workflow,If comments were allowed for me( i just started using stack) I would say you can use the vim command :v/*/d I don't get why it's more cumbersome. If you are forced to manually put stars(*) on every line of interest then the ticking of the hypothetical check-boxes might be even more troublesome.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.