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

Re: Newbie-Question: awk: How does this wonderfull tool work?



Le 2002.01.20 00:00, a.maresch@aon.at a écrit :
> That file looks that way (minus the '|'s):
> 
> |gpg: encrypted with 2048-bit ELG-E key, ID 274AAD03, created 2001-12-22
> |      "Andreas Maresch <a_maresch@gmx.at>"
> 
> So, all I have to do is to get the text between the first '"' and the 
> '<' (minus the last space).
> 

I think sed is more appropriate:

> cat file | grep "\".*\"$" | sed 's/.*\"\(.*\) <.*/\1/'

Two steps. First gets the line with "" and then removes all before the
first " and all after the space followed by a <

Romuald.



Reply to: