Re: little bit of a nudge with grep, please?

From: jimw wagner <jpw_at_no.spam.please>
Date: Thu Jul 13 2006 - 21:57:32 CST

Dave Hall wrote:
> On Thu, Jul 13, 2006 at 06:38:40PM -0600, jimw wagner wrote:
>
>> I've found grep very useful for some of my linguistic studies (run
>> through a text and output to the Desktop a file showing every instance
>> of a particular affix or suffix or whatever).
>>
>> A sample is this:
>>
>> grep -R ?????? /home/jimw/Desktop/Conput.rtf > /home/jimw/Desktop/???.rtf
>>
>> What I'd like for it to do as well is to output the stuff with an extra
>> line in between items.
>> Is that feasible? Is there a URL that can tell me everything (not just
>> the man page)?
>>
>
> You could pipe it through sed or awk to insert an extra newline (\n):
>
> grep [-R] word infile | awk '{ print $0"\n"}' > outfile
>
> Basically put
> | awk '{ print $0"\n"}'
> just in front of the > that redirects the output to a file.
>
>
Thanks a lot, Dave. This should be a lot of help.

JimW
Received on Thu Jul 13 21:57:43 2006

This archive was generated by hypermail 2.1.8 : Fri Sep 08 2006 - 23:26:38 CST