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

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

Re: Easy for Some


From: Kevin Rodgers
Subject: Re: Easy for Some
Date: Mon, 04 Jan 2010 19:23:48 -0700
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Peter Dyballa wrote:

Am 04.01.2010 um 11:25 schrieb marioepsley:

I am a complete newbie, i downloaded aquamacs emacs yesterday, tried to use
replace string as a guess


You could use awk to print only the second column, i.e., the second by white space separated word of each line, when it exists in this record. Then it would also output the second word of the header lines which you'd need to filter:

    awk '{if (NF > 1) print $2}' <file name> | egrep -v '[^-0-9.]'

You (almost) never need to pipe awk's output through (e)grep:

awk 'NF == 2 && $2 ~ /^[0-9]+\.[0-9]+$/ {print $2}' FILE

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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