Converting text files with sed

Sed is my friend to change fixed-width text files (e.g., from an R screen output) to a comma delimited file using

sed 's/ */,/g' file1 >file2.csv

Note the two spaces between s/ and */.

Published by

greg

Atmospheric chemistry researcher and university teacher. Data analysis/chemometrics specialist (PCA, PCR, Cluster analysis, SOM)

Leave a Reply

Your email address will not be published. Required fields are marked *