Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Computer Support > Command Line File Utility?

Reply
Thread Tools

Command Line File Utility?

 
 
Slyfoot
Guest
Posts: n/a
 
      07-01-2004
Hey folks...

I need a command line utility that will remove all the lines in a .TXT
file containing a "string". For example, if I want to go through a
file and remove every line containing the word "nantucket", I'd like
to be able to type something like STRIPTXT *.TXT "nantucket" or
something similar. Anybody have an idea where I can find a utility
like that?

Thanks!

~Sly

--
Sam Campbell III
Professional Dilettante
http://www.livejournal.com/~slyfoot/
 
Reply With Quote
 
 
 
 
Slyfoot
Guest
Posts: n/a
 
      07-01-2004
On Thu, 01 Jul 2004 17:56:52 GMT, (Slyfoot) wrote:

[snip]

Hmmm, I found that using an option on a GREP utility can display all
the lines without the string in question, and then it can be
redirected to another file. That's good enough for me!

~Sly

--
Sam Campbell III
Professional Dilettante
http://www.livejournal.com/~slyfoot/
 
Reply With Quote
 
 
 
 
Gary G. Taylor
Guest
Posts: n/a
 
      07-01-2004
Slyfoot wrote:

> Hey folks...
>
> I need a command line utility that will remove all the lines in a .TXT
> file containing a "string". For example, if I want to go through a
> file and remove every line containing the word "nantucket", I'd like
> to be able to type something like STRIPTXT *.TXT "nantucket" or
> something similar. Anybody have an idea where I can find a utility
> like that?
>
> Thanks!
>
> ~Sly
>

Linux, si -- any of a number of possible tools and any of a number of
possible ways of doing it. Windows? No. Sawree.
--
Gary G. Taylor * Rialto, CA
gary at donavan dot org / http:// geetee dot donavan dot org
"The two most abundant things in the universe
are hydrogen and stupidity." --Harlan Ellison
 
Reply With Quote
 
Slyfoot
Guest
Posts: n/a
 
      07-02-2004
On Thu, 01 Jul 2004 23:48:55 GMT, "Gary G. Taylor"
<> wrote:

>Slyfoot wrote:
>
>> Hey folks...
>>
>> I need a command line utility that will remove all the lines in a .TXT
>> file containing a "string". For example, if I want to go through a
>> file and remove every line containing the word "nantucket", I'd like
>> to be able to type something like STRIPTXT *.TXT "nantucket" or
>> something similar. Anybody have an idea where I can find a utility
>> like that?
>>
>> Thanks!
>>
>> ~Sly
>>

>Linux, si -- any of a number of possible tools and any of a number of
>possible ways of doing it. Windows? No. Sawree.
>--
>Gary G. Taylor * Rialto, CA
>gary at donavan dot org / http:// geetee dot donavan dot org
>"The two most abundant things in the universe
>are hydrogen and stupidity." --Harlan Ellison


Actually I've discovered several ways of doing it now. One is using a
utility like GREP or XGREP and using redirection to files (with > or
>>). But I found a couple of fantastic little freeware commandline

utilities called YANK and LINEX that will do exactly what I want. I
just pass the string and filename(s) to YANK (with an option to ignore
case sensitivity) and it operates on the file and strips every line
that includes the "string". I've used Linux and I know how powerful
it is, but you'd be surprised at how many things you can do on the
DOS/Windows commandline!

~Sly

--
Sam Campbell III
Professional Dilettante
http://www.livejournal.com/~slyfoot/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a file line by line and write each line to a file based on the5th byte scad C++ 23 05-17-2009 06:11 PM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
use one line Perl command to add a line at the begin of a file Ting Wang Perl Misc 3 12-13-2005 06:07 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM
RUN/execute a Command-Line command from an ASP page. Lucas Cowald ASP .Net 4 10-23-2003 11:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57