Hi Lom Space!
I take it that Excel is running on your Mac that the Perl code is also running on the Mac?

There can be problems with transferring text files between: Mac,Unix and Windows because there are different "line termination" sequences. Mac uses \r, Unix \n, Windows \r\n so there can be some "weirdness".

Put the chomp(); in the code. I've found Perl to be pretty smart about dealing with line termination issues. I haven't seen Excel export a "weirdo character" when doing a text export. If you can "cat" the file, then Perl can read it. Put the chomp() in and then just print without any splits or whatever. That should work.

Now you may be exporting this spreadsheet as a .CSV file, which means "Comma Separated Value". Parsing this type of format is one of those things that appears easy, but is not so easy. There a number of Perl modules that deal with CSV but that doesn't appear to be your main problem. A CSV file is a text file.

Put the chomp() in and then just print the data lines and see if that works.


In reply to Re^3: Invisible characters by Marshall
in thread Invisible characters by lomSpace

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.