MOKRANI Rachid rachid.mokrani@ifpen.fr [sed-users]
2016-02-09 16:25:27 UTC
Hi,
Please, some assistance for the sed command to get the result below.
Input.txt
"Paul";"01 26 30 69 69";"NY"
"Dan";"05 26 30 69";"CA"
"Jane";"26 30 69";"SL"
"Bill";"03 26 30 69 69";"BT"
"Steve";"03-26-30-69-69";"BT"
"Daniel";"NA";"BO"
"Karen";"01/02/03";"YO"
I would like to have (only line with 10 digits) - remove all field less or greater than 10 digits and all fields with not numeric
Output.txt
"Paul";"01 26 30 69 69";"NY"
"Dan";"";"CA"
"Jane";"";"SL"
"Bill";"03 26 30 69 69";"BT"
"Steve";"";"BT"
"Daniel";"";"BO"
"Karen";"";"YO"
Thanks.
__________________________
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]
Please, some assistance for the sed command to get the result below.
Input.txt
"Paul";"01 26 30 69 69";"NY"
"Dan";"05 26 30 69";"CA"
"Jane";"26 30 69";"SL"
"Bill";"03 26 30 69 69";"BT"
"Steve";"03-26-30-69-69";"BT"
"Daniel";"NA";"BO"
"Karen";"01/02/03";"YO"
I would like to have (only line with 10 digits) - remove all field less or greater than 10 digits and all fields with not numeric
Output.txt
"Paul";"01 26 30 69 69";"NY"
"Dan";"";"CA"
"Jane";"";"SL"
"Bill";"03 26 30 69 69";"BT"
"Steve";"";"BT"
"Daniel";"";"BO"
"Karen";"";"YO"
Thanks.
__________________________
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]