Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Excel2Text

by mikeB (Friar)
on Dec 19, 2006 at 15:59 UTC ( [id://590690]=note: print w/replies, xml ) Need Help??


in reply to Excel2Text

In my experience, no matter what you choose for a delimiter, that character will eventually show up in the input, leading to problems parsing the generated output. You might want to escape any delimiter characters before writing the output. Alternatively, if you can get along with CSV files instead of '|' delimited files, check out Class::CSV.

Replies are listed 'Best First'.
Re^2: Excel2Text
by stonecolddevin (Parson) on Dec 19, 2006 at 21:35 UTC

    I'm not exactly certain what you mean by this reply. The "|" character is split on and only the values in between the "|" characters are used. Maybe I'm not understanding your reply, but this script's goal is to take all the fields from an Excel file and write them to a text file, separating each field by the "|" character and each row by a newline ("\n"). UPDATE: Misunderstood mikeB's comment. Yes, things can get ugly if there's a "|" in the Excel sheet like GrandFather said. However, it's just one of many options, delimit it with what you like, or you can use Class::CSV.

    meh.

      If a cell contains text with a | in it then things go a little pear shaped ;).


      DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://590690]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-12-07 02:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (49 votes). Check out past polls.