Page 1 of 1

How to delete everything between expression and end of file?

Posted: Fri Dec 02, 2005 6:06 am
by logsys
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

Posted: Mon Dec 05, 2005 8:48 am
by DataMystic Support
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.

Posted: Sat Feb 11, 2006 12:46 am
by lngzlz
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:

Posted: Sat Feb 11, 2006 12:53 am
by lngzlz
Maybe
universe.*?
should be
universe.*

Posted: Mon Feb 13, 2006 9:18 am
by DataMystic Support
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.