i need to “parse” a cvs file with sth like 400 000 lines.
The cvs looks like :
ADDRESS ZIPCODE TOWN NAME DESCRIPTION
I need to separate the 1st colum like this :
ADDRESS ZIPCODE TOWN NAME DESCRIPTION
it looks easy : add tabulation (before and after) ZIPCODE everytime i see 5 digits (all address are french Zip code).
But i don’t know how ?
I try by a sed commande line but i can’t find the good syntax. or maybe a VBA should be more suitable.
Note
column command is good solution to your problem, if your csv is really well formatted. e.g. there is no “,” in your description text.
the sed line above will check each line of your file, find the first occurrence of 5 numbers/digits and wrap it with TAB. I assume that the zipcodes in your file would be
[space]number{5}[space]the sed line would fail if there was same format in your “ADDRESS” column.