I have two sample files like this:
$ cat file1
abc,sachin
cat,kumar
$ cat file2
xyz
pressure
$ cat file3
xyz,sachin
pressure, kumar
I want the first column of file1 to be replaced with file2.
I tried doing something like this:
$ awk 'FNR==NR{a[NR]=$3;next}{$2=a[FNR]}1' file1 file2
I'm using Solaris 10 and it didn't appear to support this. Any other suggestions?