Extract lines without deleting remainder
Posted: Mon May 04, 2015 10:39 am
Struggling to find a way to extract lines from a file by reference to a pattern match, WITHOUT deleting the remaining lines. I want to send the extractions to different files. Extract lines and Remove lines seem to work by nuking what is left. For example, I have a file that has this contents
12345
123
333345
333345
65777
897777
934444
So I want an extraction function that first takes all lines beginning with "1" to "1.txt"
Then an extraction function will take all lines beginning with "3" to 3.txt
and so on.
12345
123
333345
333345
65777
897777
934444
So I want an extraction function that first takes all lines beginning with "1" to "1.txt"
Then an extraction function will take all lines beginning with "3" to 3.txt
and so on.