Skip to content
Advertisement

Split CSV values on single row into individual rows

I have a Python script that outputs a text file with thousands of random filenames in a comma separated list, all on a single row.

JavaScript

I want to take each value in the list and put it into its own row in a new CSV file.

JavaScript

I’ve tried some variations of awk with no success. What’s the best way to move these values into their own rows?

Advertisement

Answer

With GNU sed:

JavaScript

Or, for a portable alternative,

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement