http://qs321.pair.com?node_id=825916


in reply to How to create an accurate CSV file

It seems you need to understand text parsing. Simply stated, your script assumes one space and a dozen spaces are the same. Obviously this is wrong, and you need to account for each column of data in a hard format.

Whether learning Perl to solve this particular problem is the path to your solution only you can answer. I'm not totally familiar with AWK's full set of features, but I do know there are some fine columnar tools in 'cut'.