| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Hi, (and happy new year !)
I have to compare 2 files. These 2 files have many lines/columns. Each column may have changed, and each can contain identical information.
Only the "id" column is unique. The "Id" number is unique. This number is single one time, there was never duplicates.
My file 2015.txt
"id";"Company";"NAME ";"FIRSTNAME";"JOB";"Town";"PHONE"
"111222333";"Company A";"NAME A ";"FIRSTNAME 1";"JOB 1";"Town 1";"PHONE 1"
"111222334";"Company A";"NAME A ";"FIRSTNAME 4";"JOB 1";"Town 1";"PHONE 1"
"118822333";"Company B";"NAME T ";"FIRSTNAME 1";"JOB 2";"Town 2";"PHONE 65"
"111275333";"Company C";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"PHONE 6"
My new file 2016.txt
"id";"Company";"NAME ";"FIRSTNAME";"JOB";"Town";"PHONE"
"111222333";"Company A";"NAME A ";"FIRSTNAME 1";"JOB 1";"Town 1";"PHONE 1"
"111222334";"Company Z";"NAME A ";"FIRSTNAME 4";"JOB 1";"Town 1";"PHONE 1"
"111275333";"Company C";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"PHONE 6"
"991275333";"Company Y";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"PHONE 6"
"881275333";"Company Y";"NAME M ";"FIRSTNAME 25";"JOB 7";"Town 1";"PHONE 6"
When I receive the new file 2016.txt I would like to identify all the differences with the first file 2015.txt
Wich lines are remove, modify, and wich lines are new in the file 2016.txt
For exemple I would like to have 3 files.
Compare 2015.txt and 2016.txt to print what lines are remove.
Remove_from _2015.txt need to have the result:
"118822333";"Company B";"NAME T ";"FIRSTNAME 1";"JOB 2";"Town 2";"PHONE 65"
Compare 2015.txt and 2016.txt to print what is modify.
Lines_modify_from_2015.txt
"111222334";"Company Z";"NAME A ";"FIRSTNAME 4";"JOB 1";"Town 1";"PHONE 1"
Compare 2015.txt and 2016.txt to print what lines are new.
New_Lines_2016.txt
"991275333";"Company Y";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"PHONE 6"
"881275333";"Company Y";"NAME M ";"FIRSTNAME 25";"JOB 7";"Town 1";"PHONE 6"
PS : I use sed/awk on CentOS.
Any help,
Many thanks in advance.
__________________________
Avant d'imprimer, pensez à l'environnement ! Please consider the environment before printing !
Ce message et toutes ses pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. IFP Energies nouvelles décline toute responsabilité au titre de ce message. This message and any attachments are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP Energies nouvelles should not be liable for this message.
__________________________
[Non-text portions of this message have been removed]