in reply to Quoting words

If you don't know what type of file it is (commas or tabs) then you may have a problem because if you convert all the commas to tabs in a file you could end up converting legitimate commas to tabs. I'm not certain if the reverse would be true. (but I would assume so). But the conversion is pretty easy:
open(FILE,"+<tabs.txt") or die "Couldn't open tabs.txt: $!"; my @file = <FILE>; seek(FILE,0,0); foreach(@file) { s/\t/,/g; print FILE $_; } close(FILE);

Now for putting quotes around your values:

open(FILE,"+<tabs.txt") or die "Couldn't open tabs.txt: $!"; my @file = <FILE>; seek(FILE,0,0); foreach(@file) { chomp(); my $line = ""; my(@values) = split(/\,/,$_); foreach my $value(@values) { $value = "\"$value\"" if $value !~ /^\".*?\"$/; $line .= "$value,"; } chop($line); print FILE "$line\n"; } close(FILE);

Hope that helps