Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It's not quite that simple. Excel, at least in English-based locales, uses commas to separate formula options. If you try to replace commas with nothing, Excel will stop at the first critical comma in a formula and complain. Non-critical commas will probably result in wrong results or #NAME. Therefore, if you are in such a locale, you have two options that are immediately obvious to me. One is to change locale to something that uses a different character (I think France uses semicolons, for example). The other is to copy everything and Paste Special Values. Then you can use the usual Excel find & replace tool, Ctrl-H, before writing the CSV.
An option here is to use a special character, something you wouldn't expect to see anywhere. Then, once you have imported the data into Perl, you can replace every special character with a comma and get back to the embedded commas which are, I suspect, what you are having trouble with. There's an interesting thread on CSVs still active at problems parsing CSV. Regards, John Davies In reply to Re: Win32::OLE Excel search and replace commas
by davies
|
|