Join 4 files on first three columns

view story

http://www.unix.com – Hi, Can someone suggest me on how to join 4 files by comparing the first three columns? ---------- Post updated at 03:56 PM ---------- Previous update was at 03:42 PM ---------- Hope it helps someone. I was looking online for a solution and on stackoverflow, I found a solution and tried the following command Code: awk '{o1=$1;o2=$2;o3=$3; $1=$2=$3="";gsub(" +","");_[o1 FS o2 FS o3]=_[o1 FS o2 FS o3] FS $0} END{ for(i in _) print i,_[i] }' file1 file2 My input files are this way input1: Code: a 1 2 3 x b 3 4 5 y c 6 7 8 z input2: Code: a 1 2 (HowTos)