Hi,
I am using perl to a parse a raw database dump to a csv file. The problem is that it's not formatted correctly for Excel. I need to add a header to the top of the file, and also remove all the commas. This could be done in a perl one liner, but this is part of a larger perl script so I want to do it in the main perl script. I was trying something like this:
print "Formatting csv file... $csvFile\n";
open IN, '<', $csvFile or die;
my @contents = <IN>;
close IN;
@contents =~ s/\'//g;
open OUT, '>', $csvFile or die;
print OUT @contents;
close OUT;
You can do this of course:
@contents =~ s/\'//g;
I need to remove the commas and add a line to the top of the file. Any ideas?