CSV File
Hey all :)
I have a CSV file that I want to make into a big list, i.e. fred,harry,frank into fred harry frank What would be the best way to do this, I know I could run the command (a getent for samba), filter it through to one file and then replace with vi but I thought there'd be a better way... Any ideas would be really helpful :) |
You can do it with a single sh command line. The following command creates the list by replacing the commas with newlines, and sorts it in asciibetical order:
Code:
cat input.csv | sed 's/,/\n/g' | sort Code:
cat input.csv | sed 's/,/\n/g' | sort > output.list |
The power of sed. I've got a couple of scripts with it in but I still haven't figured it out lol :P
Thanks for ur help, worked perfectly :) |
All times are GMT -5. The time now is 10:20 PM. |