Help in awk/bash | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Help in awk/bash

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-28-2012
bioinfo bioinfo is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 12 August 2013, 3:07 AM EDT
Posts: 50
Thanks: 52
Thanked 0 Times in 0 Posts
Help in awk/bash

Hi, I am also a newbie in awk and trying to find solution of my problem.

I have one reference file 1.txt with 2 columns and I want to search other 10 files (a.txt, b.txt......h.txt each with 5 columns) corresponding to the values of 2nd column from 1.txt. If the value from 2nd column from 1.txt matches with the value of 4th column of 10 files, then print the row as well as file name.
Also, in 1.txt for eg. 1st value is -191.632 but originally in a.txt it is -191.6318, so I also want to print values same upto two decimal places and rest places can be any number.

1.txt:


Code:
1.35732	-191.632
1.36229	-190.8716
1.35503	-191.3254
1.35597	-191.2652

a.txt:


Code:
271640.000	 0.49000	 -0.0000036574 -191.6318 -183.82380	
271650.000	 0.49155	 0.0000033909	 -198.30111	 -198.73140	
271660.000	 0.48775	 0.0000014657	 -191.3254 -199.84910	
271670.000	 0.48212	 -0.0000004152 -195.48446	 -193.15580

Please guide.
Thanks

Last edited by joeyg; 12-28-2012 at 09:43 PM.. Reason: Double post. Closed.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help in awk/bash bioinfo Shell Programming and Scripting 33 01-10-2013 02:08 PM
AWK/Bash script chrisjorg Shell Programming and Scripting 3 05-10-2012 01:48 PM
scripting help with bash and awk garethsays Shell Programming and Scripting 3 05-30-2009 11:18 AM
awk bash help a-gopal Shell Programming and Scripting 2 05-08-2009 09:39 PM
BASH with AWK narasimhulu Shell Programming and Scripting 2 08-26-2008 12:59 AM



All times are GMT -4. The time now is 08:54 AM.