Talk About Network

Google


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 > match nth field...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 2120 of 2317
Post > Topic >>

match nth field and print the whole result

by aclhkaclhk <access_you@[EMAIL PROTECTED] > Jan 4, 2008 at 02:39 AM

We have a number of files:

1~peter~hello.txt
2~tom~bye.txt
3~ken~love.txt
4~tom~good.txt

we would like to search for 2nd field containing "tom" and print the
whole filenames.
2~tom~bye.txt
4~tom~good.txt

we would search something like this:
eg. ls . | awk -F"~" '{print $0}'

pls advise what awk construct could give my output.
 




 6 Posts in Topic:
match nth field and print the whole result
aclhkaclhk <access_you  2008-01-04 02:39:24 
Re: match nth field and print the whole result
Janis Papanagnou <Jani  2008-01-04 13:15:31 
Re: match nth field and print the whole result
pop <p_o_p@[EMAIL PROT  2008-01-04 14:37:34 
Re: match nth field and print the whole result
Ed Morton <morton@[EMA  2008-01-04 15:01:00 
Re: match nth field and print the whole result
aclhkaclhk <access_you  2008-01-04 20:31:42 
Re: match nth field and print the whole result
Janis Papanagnou <Jani  2008-01-05 05:36:02 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Fri Jul 25 15:06:16 CDT 2008.