![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| merging two files | rameshonline | Shell Programming and Scripting | 14 | 04-06-2009 01:20 AM |
| Need help in extracting columns | praveenbvarrier | Shell Programming and Scripting | 6 | 04-03-2008 02:06 AM |
| Merging two files | venommaker | UNIX for Dummies Questions & Answers | 4 | 01-10-2008 08:15 AM |
| merging two files based on some key | Vandana Yadav | Shell Programming and Scripting | 1 | 02-03-2006 09:45 AM |
| merging few columns of two text files to a new file | kolvi | Shell Programming and Scripting | 4 | 09-15-2005 04:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Extracting columns from different files for later merging
Hello!
I wan't to extract columns from two files and later combine them for plotting with gnuplot. If the files file1 and file2 look like: fiile1: a, 0.62,x b, 0.61,x file2: a, 0.43,x b, 0,49,x The desired output is a 0.62 0.62 b 0.61 0.49 Thank you in advance! |
|
||||
|
I'm guessing you mistyped your expected results:
using file1: Code:
a, 0.62,x b, 0.61,x Code:
a, 0.43,x b, 0.49,x Code:
a 0.62 0.43 b 0.61 0.49 Code:
tr -s ',' ' ' < file1 > newfile1
tr -s ',' ' ' < file2 > newfile2
join newfile1 newfile2 | awk '{print $1,$2,$4}'
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|