How to delete everything between expression and end of file?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

logsys
Posts: 1
Joined: Fri Dec 02, 2005 5:40 am

How to delete everything between expression and end of file?

Postby logsys » Fri Dec 02, 2005 6:06 am

Hello,

I have the following problem:

I have 79500 .txt files (from 2kb to 400kb). In all these files is a special expression (for example "universe"). I want to delete ALL characters between
"universe" and the end of the file (including "universe"). The expression "universe" is in each file on a different place.

Please can you give me an example filter (.fll) to solve this problem? I am sure TextPipePro is able to realize this. I tried the last 2 days to find a
solution but without success :-(

Thank you for your efforts and best regards from Germany
Oliver Sacher

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

Postby DataMystic Support » Mon Dec 05, 2005 8:48 am

Hi Oliver,

The solution is to use a perl pattern for

universe.*?

(replace with nothing)

and to click the [...] button to change the maximum allowed match size from 4096 (the default) to 400kb.
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

lngzlz
Posts: 41
Joined: Wed Sep 21, 2005 10:43 pm

Postby lngzlz » Sat Feb 11, 2006 12:46 am

As I test Simon's solution, it only deletes the word "universe" instead of any text between "universe" and the end of file. :oops:

I am not sure what's wrong. :cry:

lngzlz
Posts: 41
Joined: Wed Sep 21, 2005 10:43 pm

Postby lngzlz » Sat Feb 11, 2006 12:53 am

Maybe
universe.*?

should be
universe.*

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

Postby DataMystic Support » Mon Feb 13, 2006 9:18 am

The default for perl patterns is to be ungreedy, in which case what I wrote is correct.

If you've changed this default to greedy, then your pattern of
universe.*

would be correct.
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


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

Who is online

Users browsing this forum: No registered users and 6 guests