I’ve banged my head on this long enough.
I have a text file in the format:
col1 col2 col3 col4 col5 Then there’s a big ol’ string at the end
and I want to get it in the form:
col1,col2,col3,col4,col5,“Then there’s a big ol’ string at the end”
Each of the first columns can be variable length, as can the string at the end. Fine, I think. AWK knows how to parse columns. Which it does, just fine. I can say AWK ‘{ print $1 “,” $2 “,” $3 “,” $4 “,” $5 “,” }’ and it does just what I need.
However, that last string at the end is giving me somewhat of a problem. As it’s variable length, I can’t just dumpe the fields. Plus, I’d like to preserve any spaces between the words. Anyone have any suggestions?