It looks like $file = '"'.$file; would be really slow because you are copying the entire file.
Anyway, it looks like you only need one regular expression (and transliteration):
my $file = <$INPUT>; $file =~ s/(?:(?<=^)|(?<=\t))([^\t\n]*)(?=[\t\n])/"$1"/mg; $file =~ tr/\t/,/;
In reply to Re: Making CSV Files from Tab Delimited Files
by jwkrahn
in thread Making CSV Files from Tab Delimited Files
by MajingaZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |