Re: access nth argument list in a file
From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 03/22/05
- Next message: Jeremiah DeWitt Weiner: "Re: How to write to stdin of another process?"
- Previous message: zippy747: "Re: access nth argument list in a file"
- In reply to: zippy747: "Re: access nth argument list in a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 21 Mar 2005 18:23:43 -0600
zippy747 wrote:
> I have a file that has this content:
>
> includes="a b c d"
> somethingelse="foo"
> includes="e f g h"
>
> I want to parse out each token after an includes=
>
> In this case I want to parse out
> a
> b
> c
> d
> e
> f
> g
>
> Thanks,
> -zip
>
Assuming you mean to include "h" in the output and that the only double
quotes are around the string of tokens:
awk '/^includes/{gsub("\""," ");for (i=2;i<=NF;i++) print $i}' file
Ed.
- Next message: Jeremiah DeWitt Weiner: "Re: How to write to stdin of another process?"
- Previous message: zippy747: "Re: access nth argument list in a file"
- In reply to: zippy747: "Re: access nth argument list in a file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|