Awk asking combine two files
问题 I have combined two different files with Same Key by AWK command. And In case there is no key match compare to File1 and File2 then just put "\t\t\t" instead. I have below AWK command. awk -F"\t" ' {key = $1} NR == 1 {header = key} !(key in result) {result[key] = $0 ; next} { for (i=2; i <= NF; i++) result[key] = result[key] FS $i } END { print result[header],"\tValue2","\tValue3","\tValue4" delete result[header] PROCINFO["sorted_in"] = "@ind_str_asc" # if using GNU awk for (key in result)