Ugly CSV Adventure and possible clean-whitespace issue #603
-
I'm having a real adventure trying to fix a CSV produced by AWS Inspector. Miller actually did pretty well with clean-whitespace but it did give me a bit of feedback to pass along. I also want to see if I can get some pro-tips on getting this automated. Here is what I'm dealing with. Sample is from the full CSV with columns 3,19 cut.
It goes on like this for 115 rows. But let's check on that whitespace using
Aye caramba! After
It's hard to see the issue, but there is still a LF after the colon in the Recommendation column, or perhaps before the octothorpe that follows the colon. All I did was Any advice is welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
An interesting (?) quirk, both Miller and Csvkit format this CSV the same and if I cut (using either csvcut or mlr) columns 3, 16, and 19 instead of only 3, 19 then it is formatted well by both tools. I'm new to the CSV scene so I don't really understand what is going on here. |
Beta Was this translation helpful? Give feedback.
-
Please could you share in gist a sample input csv file? |
Beta Was this translation helpful? Give feedback.
-
If you run
you this output https://gist.github.com/aborruso/b27acbb257beb41ff3a17c29d5bd56e4 Is this what you want? |
Beta Was this translation helpful? Give feedback.
-
Only 3 columns
the output is this https://gist.github.com/aborruso/1cfbb905d82c749114b8ace5d04e7212 |
Beta Was this translation helpful? Give feedback.
Only 3 columns
the output is this https://gist.github.com/aborruso/1cfbb905d82c749114b8ace5d04e7212