Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: awk Parsing...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 2143 of 2236
Post > Topic >>

Re: awk Parsing Question

by js <joke_smit@[EMAIL PROTECTED] > Jan 28, 2008 at 09:29 PM

mooshak@[EMAIL PROTECTED]
 schreef:
> Hi All,
> 
> My apologies if this has been covered in the past.
> 
> I am trying to parse lines in a file.   I would like to catpure
> anything after $8 as one variable. For example, in the line below, I
> would like "insert into schema.tab values" to be $8.  By default, awk
> parses the word 'insert' as $8.
> 
> Is there an easy way to do it?
> 
> 
> 0x078000007E1B3840 14     41382      1          1          2
> 2          insert into schema.tab values
> 
> 
> Thanks
> 
> Moosh
how about:
	for (i=9;i<=NF;i++) $8=$8" "$i


then
	print $8
yields:
insert into schema.tab values




 4 Posts in Topic:
awk Parsing Question
mooshak@[EMAIL PROTECTED]  2008-01-28 10:49:27 
Re: awk Parsing Question
Janis Papanagnou <Jani  2008-01-28 20:07:13 
Re: awk Parsing Question
Ed Morton <morton@[EMA  2008-01-28 14:20:45 
Re: awk Parsing Question
js <joke_smit@[EMAIL P  2008-01-28 21:29:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 3:02:36 CDT 2008.