Skip to content

Instantly share code, notes, and snippets.

@TheHiddenHaku
Last active August 29, 2015 14:15
Show Gist options
  • Save TheHiddenHaku/19c23ab892686080df1e to your computer and use it in GitHub Desktop.
Save TheHiddenHaku/19c23ab892686080df1e to your computer and use it in GitHub Desktop.
diff csv
paste file1 file2 | awk -F "[,\t]" '{for(i=1;i<=(NF/2);i++){if($i != $(NF/2+i)){
if(s){s=s";"$i}else{s=$i}}else{if(s){s=s";,"}else{s=","}}}}{ print s;s=""}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment