How to delete everything between expression and end of file?

Get help with installation and running here.

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

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

How to delete everything between expression and end of file?

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

Post 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.
lngzlz
Posts: 41
Joined: Wed Sep 21, 2005 10:43 pm

Post 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:
lngzlz
Posts: 41
Joined: Wed Sep 21, 2005 10:43 pm

Post by lngzlz »

Maybe
universe.*?
should be
universe.*
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post 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.
Post Reply