But it does not guarantee that the output is a valid CSV-file, or at least have the same number of fields in each record as before:use Modern::Perl; while (<DATA>) { tr/"/'/; print; } __DATA__ Dit, is, een, "CSV record" En, dit, "ook", ! En, hij , zei, "'Hallo, hoe gaat het?'"
Dit, is, een, 'CSV record' En, dit, 'ook', ! En, hij , zei, ''Hallo, hoe gaat het?''Far better to use a module like Text::CSV to read in your CSV-file and output it again with this module, but with different delimiters (such as a single quote instead of double quotes).
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re: Substituting characters
by CountZero
in thread Substituting characters
by newtoperl123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |