[Novalug] remove commas from .csv files
pereira at speakeasy.net
Sat Mar 6 11:12:19 EST 2010
Hi smart people,
In a directory I have a slew of comma-separated files, each with two columns.
In this same directory, which has nothing else, I want to make new files
wherein the commas are replaced by spaces, and the original file name
foo.csv becomes foo.dat.
Copying from an earlier discussion on this list, I do
sed -e "s/,/ /" foo.csv > foo.dat
and so on, replacing foo by whatever the file names are.
This works. But, being lazy, I'd want to avoid typing all these
file names, so I try
sed -e "s/,/ /" *.csv > *.dat
Now I get one big file called *.dat, which is useless.
What's the right way to do this? Something with if ... fi no doubt,...
More information about the Novalug