Beefy Boxes and Bandwidth Generously Provided by pair Networks
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
in thread Win32::OLE Excel search and replace commas by generator

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2024-04-23 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found