![]() |
|
|
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 |
| how to read record by record from a file in unix | raoscb | UNIX for Dummies Questions & Answers | 1 | 05-16-2008 07:30 AM |
| match a phrase | vanitham | Shell Programming and Scripting | 4 | 01-16-2008 02:18 AM |
| Script to search a bad record in a file then put the record in the bad file | shilendrajadon | Shell Programming and Scripting | 2 | 12-28-2007 10:02 AM |
| Script to search a bad record in a file then put the record in the bad file | shilendrajadon | UNIX for Advanced & Expert Users | 1 | 12-28-2007 10:00 AM |
| splitting a record and adding a record to a file | rsolap | Shell Programming and Scripting | 1 | 08-13-2007 02:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
record match
Hello.,
i have to txt files.., FILE1=/home/pavi/DS.txt FILE2=/home/pavi/chain.txt awk -F ":" '{print $1}' $FILE1 > f1.txt awk -F " " '{print $2}' $FILE2 > f2.txt DS.txt contains; ALBD:xxxxx FLN:yyyyyyy WLG:ttttttt chain.txt contain; ECK: ECK: 331 ECK: ECK: 336 FED :FED :427 FIE :FIE: 212 FLN :FLN: 140 FLN :FLN :141 FMF: FMF: 183 FR1 :FR1: 303 FTT :FTT :423 GAT :GAT: 185 GEN :GEN: 396 GFY :GFY: 268 GIA :GIA: 228 GMD :GMD: 264 MIN: MIN: 158 MRO :MRO: 354 MY0 :MY0: 315 NCS :NCS: 390 OSC :ALBD: 377 OSC :ALBD :378 OSC: ALBD: 379 OSC ALBD 380 WLG :WLG :243 MAT: WLG :247 the result.txt has to look like this; OSC :ALBD: 377 OSC :ALBD :378 OSC: ALBD: 379 FLN :FLN: 140 FLN :FLN :141 WLG :WLG :243 MAT: WLG :247 the script has to match the 1st column from DS.txt with the 2nd column of chain.txt and only those that matched, move all the corresponding 1st , 2nd and 3rd columns of chain.txt to a output file say result.txt this is what i am trying to accomplish. can anyone please help me .. tx pavi |
|
|||||
|
Please read our rules which state:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post where your goal is to get an answer more quickly. I will close this duplicate thread. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|