Delete Records That Do Not Match

General questions about using WildEdit

Moderators: AmigoJack, helios, bbadmin, Bob Hansen, MudGuard

Post Reply
ScaleTraining
Posts: 1
Joined: Sun Sep 03, 2023 7:55 pm

Delete Records That Do Not Match

Post by ScaleTraining »

I have 260 text files, about 2-3MB each. The city name is located at column 304. How do keep all records with Denver at that location OR I how do I delete all records that do not contain Denver? Should I use TextPad or WildEdit?
ben_josephs
Posts: 2456
Joined: Sun Mar 02, 2003 9:22 pm

Re: Delete Records That Do Not Match

Post by ben_josephs »

In WildEdit you can remove all lines that do not contain the text Denver anywhere with
Search for:
^(?!.*Denver).*\r?\n

[X] Regular expression
[ ] "." matches end of line charactres [i.e., not selected]

Replace with:
[nothing]

Options
Regular expression syntax
[X] Perl/ECMAscript
(?!.*Denver) is a look-ahead assertion. It matches no characters, but only if Denver does not occur anywhere in the text that follows.
Post Reply