Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: to csv file

by hdb (Parson)
on Jun 29, 2013 at 07:54 UTC ( #1041415=note: print w/ replies, xml ) Need Help??


in reply to to csv file

Excel can open text files with semikolon as separator! You can also specify two semikolons as separators! No need to change your file.




Comment on Re: to csv file
Download Code
Re^2: to csv file
by space_monk (Chaplain) on Jun 29, 2013 at 08:38 UTC
    Actually I think Text::CSV and the others only work with single character separators. From Text::CSV:
    sep_char
    The char used for separating fields, by default a comma. (,). Limited to a single-byte character, usually in the range from 0x20 (space) to 0x7e (tilde).

    The separation character can not be equal to the quote character. The separation character can not be equal to the escape character.
    If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
      output in csv viewed in excel should look like abd|sasa|trre|dsa|sdas|dsss

      I just thought that if the input would be opened in Excel specifying two semicolons as separators it would look exactly like described in the OP.



        I really must read more carefully in the morning! :-P
        If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)
Re^2: to csv file
by ww (Bishop) on Jun 29, 2013 at 15:30 UTC

    Re hdb's observation that "Excel can open text files with semikolon as separator! You can also specify two semikolons as separators!"

    True, but at least with Excel 2000, you'll find you have numerous hoops (popup selection choices) to jump through to open a text file with a doubled semi-colon as the separator. (Dunno 'bout other, more-recent versions. Too cheap to own'em).

    If you didn't program your executable by toggling in binary, it wasn't really programming!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-07-25 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls