Extract lines without deleting remainder

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
simoninsing
Posts: 20
Joined: Fri Jun 05, 2009 11:11 pm

Extract lines without deleting remainder

Post by simoninsing »

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.
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract lines without deleting remainder

Post by DataMystic Support »

Easy - use a Filters\Restrict\Restrict to lines matching pattern list.

And inside this, put a Filters\Special\Secondary output filter

The original text will flow on unchanged, with matching text pushed out to the new file.
Regards,

Simon Carter, https://www.DataMystic.com
https://www.JadeDiabetes.com - Insulin dose calculator for Type 1 diabetes
https://www.DownloadPipe.com - 250,000 free software downloads
simoninsing
Posts: 20
Joined: Fri Jun 05, 2009 11:11 pm

Re: Extract lines without deleting remainder

Post by simoninsing »

Got it, thanks Simon
Post Reply