help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A very simple question on SED or AWK for a GURU, possibly a lisp scr


From: Stefan Monnier <address@hidden>
Subject: Re: A very simple question on SED or AWK for a GURU, possibly a lisp script or emacs batch processing of many files
Date: 14 Jan 2003 14:34:02 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "ericjb" == ericjb  <ericjb@lksejb.lks.agilent.com> writes:
>> Here is the type of lines I have in a file:
>> junk  label="junk1/junk2/junk3/.../junkn/" more junk
>> I want to find every line that has
>> label="..."
>> pattern
>> and then I want to replace every / by _ inside the
>> quotes.

sed '/label=".*"/s|/|_/'

>> cat file |
>> sed commands |
>> awk commands |

I don't know if the Useless Use of Cat Award is still up for grabs,
so I'd recommend you don't bother running for it and just use
redirection instead:

  sed commands <file |
  awk commands |


-- Stefan


PS: This has nothing to do with Lisp, Emacs, or GNU, so I redirected
    the discussion to comp.unix.shell.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]