Re: search string in column ans delete line
| Newsgroups | gmane.editors.sed.user |
|---|---|
| Message-ID | <SN1PR13MB05925DBCE162B124C600B3ECB9800@SN1PR13MB0592.namprd13.prod.outlook.com> |
>> Requirement: if find alphabetic characters (a-z A-Z) in column 7, delete the line. sed -e ' s/;/\n/7 s/;/\n/6 /\n.*[a-zA-Z].*\n/d y/\n/;/ ' yourcsvfile ________________________________ From: [email protected] <[email protected]> on behalf of MOKRANI Rachid [email protected] [sed-users] <[email protected]> Sent: Tuesday, March 22, 2016 9:19 AM To: [email protected] Subject: search string in column ans delete line Hi, Do you have a simple proposal with sed / awk. if I find alphabetic characters (a-z A-Z) in column 7 I want to delete the line. "111222333";"Company A";"NAME A ";"FIRSTNAME 1";"JOB 1";"Town 1";"52.45.0";"COMMENT 1"; "111222334";"Company A";"NAME A ";"FIRSTNAME 4";"JOB 1";"Town 1";"PH56.2458";""; "118822333";"Company B";"NAME T ";"FIRSTNAME 1";"JOB 2";"Town 2";"aGrfDPHONE 65"; "COMMENT 1235"; "111275333";"Company C";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"14582";""; "55222334";"Company Y";"NAME G ";"FIRSTNAME 4";"JOB 52";"Town 1";"-45852";""; "1258425";"Company Y";"NAME F ";"FIRSTNAME 8";"JOB 82";"Town 3";"+45 85 20";""; Need to obtain the result below. "111222333";"Company A";"NAME A ";"FIRSTNAME 1";"JOB 1";"Town 1";"52.45.0";"COMMENT 1"; "111275333";"Company C";"NAME M ";"FIRSTNAME 2";"JOB 7";"Town 1";"14582";""; "55222334";"Company Y";"NAME G ";"FIRSTNAME 4";"JOB 52";"Town 1";"-45852";""; "1258425";"Company Y";"NAME F ";"FIRSTNAME 8";"JOB 82";"Town 3";"+45 85 20";""; Thanks, Best regards. __________________________ 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] [Non-text portions of this message have been removed]