Text editor with the ability to remove lines not matching a pattern

  • Thread starter Thread starter asdasdassad
  • Start date Start date
A

asdasdassad

Hi. I have a bunch of text files, and I want to remove all the lines
which do *not* begin with a certain pattern. I haven't found any
software capable of doing this.

I'll be very grateful if you can recommend anything suitable for me.

TIA
 
Hi. I have a bunch of text files, and I want to remove all the
lines which do *not* begin with a certain pattern. I haven't
found any software capable of doing this.

I'll be very grateful if you can recommend anything suitable for
me.

Why use a text editor? Personally, I'd just use grep...you can use
it to search for a regular expression, and then only output the
matching lines. You can also invert it so that you get the lines
that don't match, if you wish. If you're interested in that, you
can try

http://www.interlog.com/~tcharron/grep.html
 
asdasdassad said:
Hi. I have a bunch of text files, and I want to remove all the lines
which do *not* begin with a certain pattern. I haven't found any
software capable of doing this.

You might look into the standalone utility, Line Stripper. It can be run
GUI or CLI. In GUI mode, you would checkmark the applicable boxes:

String to Find: _________
[x] String at Start of Line
[x] Drop Line if Not Present

http://www.lexacorp.com.pg/miscsoft.html
http://www.lexacorp.com.pg/soft/linestrp.exe (22k)

| Text File Line Stripper
|
| A utility to strip or modify lines from a text document (or text
| copied to the clipboard) if the lines contain a certain string (or
| alternatively, if they don't contain the string).
 
omega said:
asdasdassad said:
Hi. I have a bunch of text files, and I want to remove all the lines
which do *not* begin with a certain pattern. I haven't found any
software capable of doing this.

You might look into the standalone utility, Line Stripper. It can be run
GUI or CLI. In GUI mode, you would checkmark the applicable boxes:

String to Find: _________
[x] String at Start of Line
[x] Drop Line if Not Present

http://www.lexacorp.com.pg/miscsoft.html
http://www.lexacorp.com.pg/soft/linestrp.exe (22k)

| Text File Line Stripper
|
| A utility to strip or modify lines from a text document (or text
| copied to the clipboard) if the lines contain a certain string (or
| alternatively, if they don't contain the string).

Thanks, Karen, also other nice small utilities at that site.

Mike Sa
 
Back
Top