Forum Moderators: phranque

Message Too Old, No Replies

Grep, Writing to a File

         

brotherhood of LAN

10:03 am on Jun 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello peoplee,

I'm sure some of you have do something similar ot this everyday with logfiles, I wouldnt mind something similar ;)....

I have the DMOZ RDF, well the cat structure RDF, and the file is quite large, so my lowly puny memory has trouble opening it.

I was wondering if anyone knew if I could use grep (or something similar) to put all my REGEX matches into a file. I have a copy of borland which has similar grep tools (i think)....anyone know of a good way to get this done (hopefully with grep)?

I couldnt see any flags in grep to write to a file, was wondering if there's a related prog (or a hidden command) to help get this done ;)

bcc1234

10:10 am on Jun 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just redirect the standard output to a file.

brotherhood of LAN

10:16 am on Jun 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any chance you have a command to go with the advice? ;)

Cheers

RonPK

10:29 am on Jun 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Something like this:

grep [options] PATTERN > yourfile.txt

davester28

3:05 pm on Jun 29, 2003 (gmt 0)

10+ Year Member



Just to add to the above, you can also...

grep [options] PATTERN >> yourfile.txt

This will append to the end of the file.

Hope this helps as well.
Davester28

brotherhood of LAN

12:09 pm on Jul 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Cheers folks,

Almost running out of 'memory' remembering all these progs/commands ;) Thanks for the pointers.