Delete lines with less than a certain amount of characters?

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
Sarrkazztic
Posts: 1
Joined: Wed Nov 26, 2008 3:15 pm
Location: Evansville Indiana
Contact:

Delete lines with less than a certain amount of characters?

Post by Sarrkazztic »

Example: This is from a find in files search the shorter rows are useless



20081124\00003603.txt(154): "00239577.tif",
20081124\00003603.txt(155): "4016034092515287","00239579.tif",
20081124\00003603.txt(156): "00239579.tif",
20081124\00003603.txt(157): "4001099952321605","00239581.tif",
20081124\00003603.txt(158): "00239581.tif",
20081124\00003603.txt(159): "4004668812474077","00239583.tif",
20081124\00003603.txt(160): "00239583.tif",

I wrote a macro to set each piece of data into a column for importing into Access. The macro replaces the \ ( ) , characters with Pipe | and deletes the : and "s


The line numbers (xxx) are ignored during the import process.


Results in

20081124|00003603.txt|151|4005141442191365|00239575.tif|
20081124|00003603.txt|152|00239575.tif|
20081124|00003603.txt|153|4016879092507134|00239577.tif|
20081124|00003603.txt|154|00239577.tif|
20081124|00003603.txt|155|4016034092515287|00239579.tif|
20081124|00003603.txt|156|00239579.tif|
20081124|00003603.txt|157|4001099952321605|00239581.tif|
20081124|00003603.txt|158|00239581.tif|
20081124|00003603.txt|159|4004668812474077|00239583.tif|
20081124|00003603.txt|160|00239583.tif|



Now what I want to be able to do is delete all the rows that are shorter than say 50 characters.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ^.{0,49}\n
Replace with: [nothing]

[X] Regular expression

Replace All
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Post Reply