![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| AWK Multi-Line Records Processing | RacerX | Shell Programming and Scripting | 10 | 10-18-2007 09:46 PM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
| multi file editing in vi | ricl999 | Shell Programming and Scripting | 0 | 04-21-2006 08:23 AM |
| Multi User Multi Task | Reza Nazarian | UNIX for Dummies Questions & Answers | 6 | 04-13-2006 10:23 AM |
| multi-file multi-edit | kielitaide | UNIX for Dummies Questions & Answers | 12 | 06-28-2001 04:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Multi File processing
Hello,
I have 2 csv files: File1: Name,year,organization Jim,2007,Org1 Bob,1999,Org3 Chris,2001,Org2 File2: DocumentName,DocumentTitle,organization,year Test1,Test1,Org1,2007 Test2,Test2,Org2,2008 Test3,Test3,Org3,2009 Using the ksh, I'm reading by line and grabbing the value in the 2nd column ($2). I want to use this value and search the second file to find a line with a match. If it is found I want to grab the value of column 1 ($1) of the second file during that read while readline do if test $i -ge 1; then echo "$line" awk '{print $1","$2}' >> File3 now use $2 to search File2 for a match if found print the value of $1 in File2 to File3 fi done < $File1 Result Jim,2007,Test1 Can anyone give me some insight as to how this can be done? thanks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|