in reply to Re: Content of one file to another file if a filed matches
in thread Content of one file to another file if a filed matches
Very nice. I didn't know about the autosplit, -a, option. One small improvement, I added the letter at the beginning of each line as requested by the OP. I'm running this on a Windows server so I had to adjust the quotes to work.
cat File1 File2 | perl -lane "$h{$F[0]} .= qq( @F[1..$#F]); END { prin +t map qq($_$h{$_}\n), qw(A M S T Z); }" A Rahul 30 27 Apple M Radha 45 Mango S Ayaan 2 30 Sea T Rayan 72 45 Train Z Sindh 4 90 Zebra
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Content of one file to another file if a filed matches
by trippledubs (Deacon) on Mar 09, 2017 at 19:35 UTC | |
by Lotus1 (Vicar) on Mar 10, 2017 at 14:04 UTC |