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

From: Dave Hall <dave-slg_at_no.spam.please>
Date: Thu Jul 13 2006 - 18:50:55 CST

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.
Received on Thu Jul 13 18:51:13 2006

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