http://qs321.pair.com?node_id=1124471


in reply to Semicolon delimited to Comma delimited

Add a line with sep=; at the top of the csv file. Excel will read this as an instruction and override the end user's default separator. This should still be readable on your end as well but it's quite possibly specific to Excel.

Minor point but the semicolon variant isn't used everywhere in Europe but I did see it when working with a German company.

Replies are listed 'Best First'.
Re^2: Semicolon delimited to Comma delimited
by Tux (Canon) on Apr 24, 2015 at 14:34 UTC

    Support for a single first line with just sep=; has just been added to Text::CSV_XS. It will be featured in the upcoming 1.17 release.


    Enjoy, Have FUN! H.Merijn

      Wow, that's a great response time!

      Perhaps obvious but may wish to support sep=, as well, for documents going the other way (and it's nice symmetry). Excel recognizes at least these two but not sure if it'll take anything else. (I guess it'd be a bit silly to make it too general.)

        The chosen implementation makes sep=XXX valid as long as XXX adheres to the current restrictions for sep_char. This implies IIRC a maximum length of 16 bytes, UTF-8 allowed.

        I have entered the long procedure for testing. Just keep a keen eye on your favorite CPAN mirror.

        For additional pleasure, the new version will have a say method too, so you don't need two object side by side: you can now use the same object for both reading and writing.


        Enjoy, Have FUN! H.Merijn
      My respect for you just keeps climbing, Tux. Bravo.
        If you would start posting useful content instead of blowing hot air we'd have more respect for you too.
Re^2: Semicolon delimited to Comma delimited
by marinersk (Priest) on Apr 24, 2015 at 00:42 UTC

    OMG I am SO putting this in my back pocket for future use.

    Thank you!