Issue
I have a .sql file with more than 1000000 rows. I need to delete the rows that contains more than X characters on the third 'column' ( The columns are separated by comma )
I tried using some VI, SED and AWK. Also Notepad++ but did'nt succeed in any of those
(255500, 0, '0093', 0.4350, 0.4350 ) - Keep this
(255501, 0, '0035521160', 0.4350, 0.4350 ) < - Delete this
The words on the third column delimited by comma that contain less than 8 characters i wanna keep the row, the ones that are longer than 8 i need to delete the entire row.
I tried deleting manually but there is too many rows
Solution
If this isn't all you need then edit your question to clarify your requirements and provide more truly representative sample input/output:
$ awk -F, 'length($3)<8' file
(255500, 0, '0093', 0.4350, 0.4350 ) - Keep this
Answered By - Ed Morton