Page 1 of 1

Delete Records That Do Not Match

Posted: Mon Sep 04, 2023 1:26 pm
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?

Re: Delete Records That Do Not Match

Posted: Mon Sep 04, 2023 3:27 pm
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.