samedi 17 janvier 2015

merge two csv files by column header


i have two csv files


success.csv


"ID","Legacy ID","Field1", "Field2"


1,1111,google,news


2,2222,yahoo,news


error.csv


"Legacy ID","Field1","Field2","Message"


3333,aol,news,"Failed to upload data"


4444,cbs,news,"Alredy exists"


I want to merge these two files and create a new file with following fields. I can not use indexes as the size and order of fields will keep changing


results.csv


"ID","Legacy ID","Message"


1,1111,""


2,2222,""


"",3333,"Failed to upload data"


"",4444,"Alredy exists"


Please help I am new to linux commands



Aucun commentaire:

Enregistrer un commentaire