Delete Records That Do Not Match
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 1
- Joined: Sun Sep 03, 2023 7:55 pm
Delete Records That Do Not Match
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?
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
Re: Delete Records That Do Not Match
In WildEdit you can remove all lines that do not contain the text Denver anywhere with
(?!.*Denver) is a look-ahead assertion. It matches no characters, but only if Denver does not occur anywhere in the text that follows.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