[nSLUG] sed question

gnwiii at gmail.com gnwiii at gmail.com
Thu Dec 29 10:58:13 AST 2005


On 12/28/05, Stephen Gregory <nslug at kernelpanic.ca> wrote:
>
> On Wed, Dec 28, 2005 at 07:16:27PM -0400, Herb wrote:
>
> > couple of more complex ones. There are lines that have chunks that
> > need removing while keeping other chunks.
> >
> > EMAIL: address at here remove these bits
>
> try awk:
>
> awk ' /^EMAIL:/ { print $1 " " $2 }' < infile > outfile


Minor quibble:  'print $1 " " $2' uses string catenation and is less
efficient
than 'print $1, $2', which puts the output field separator (OFS) between the
two
fields.

--
George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia


!DSPAM:43b3fb10286564504516619!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/mailman/private/nslug/attachments/20051229/3d8db5f7/attachment-0001.html>


More information about the nSLUG mailing list