Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2002 17:34:01 +0000
From:      Matt H <freebsd-questions@cuntbubble.com>
To:        "adrian kok" <adriankok2000@yahoo.com.hk>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: help about awk
Message-ID:  <20020201173401.55a1ad75.freebsd-questions@cuntbubble.com>
In-Reply-To: <20020201170553.35965.qmail@web21209.mail.yahoo.com>
References:  <20020201170553.35965.qmail@web21209.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 2 Feb 2002 01:05:53 +0800 (CST)
"adrian kok" <adriankok2000@yahoo.com.hk> wrote:

> Hi all
> 
> Could you teach me how to get (data1, data2) from the
> following pattern?

make a file (t.awk for instance)

BEGIN { FS="'" } { print $6 }

then 

%echo "mail home (100,00,000,'1111-2','89','data1');" | awk -f t.awk
data1
%

replace the echo ".." with cat filename and you're away

I couldn't work out how to escape the ' in bash but making the t.awk file means I didn't have to 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020201173401.55a1ad75.freebsd-questions>