Search Results

Search: Posts Made By: asnandhakumar
2,465
Posted By spacebar
This is one way: $ cat t 08/23/2012...
This is one way:
$ cat t
08/23/2012 12:36:09,JOB_5340
08/23/2012 12:36:14,JOB_5340
08/23/2012 12:36:22,JOB_5350
08/23/2012 12:36:26,JOB_5350

$ cat test.sh
while IFS="," read inDate jobName...
4,754
Posted By RudiC
tryawk 'NR==FNR {Ar[$1] = $0; next} $2...
tryawk 'NR==FNR {Ar[$1] = $0; next}
$2 in Ar {$(NF+1)=Ar[$2]
delete Ar[$2]
}
1
' OFS="," FS="," file2 file1
4,754
Posted By cgkmal
Hello asnandhakumar, One more option for...
Hello asnandhakumar,

One more option for you.
awk -F, 'FNR==NR {x[$1]=$0;next} z=($2 in x)?$0","x[$2]:$0 {print z; x[$2]=""}' file2 file1Regards
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 04:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy