Question : Ways to merge files in linux

except using cat file1 file2 > file3. are there any ways to merge two files into one?

thanks

Answer : Ways to merge files in linux

what kinf of merge?

there are many ways, you can use sed/awk too ..

awk -F\| 'BEGIN {
while ((getline < "file2") > 0)
   f2data[$1] = $2 "|" $3 }
{c2=f2data[$2]
 if (c2=="") c2="|"
 print $0 c2 "|"
}' file1

OR :

cat file1 file2 >file3

or

cat file2 >>file1
or

tee -a file1 file2

Random Solutions  
 
programming4us programming4us