Extract lines without deleting remainder

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

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

Extract lines without deleting remainder

Postby simoninsing » 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.

User avatar
DataMystic Support
Site Admin
Posts: 2154
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract lines without deleting remainder

Postby DataMystic Support » Sun May 10, 2015 9:13 pm

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, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

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

Re: Extract lines without deleting remainder

Postby simoninsing » Sun May 10, 2015 11:53 pm

Got it, thanks Simon


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 8 guests