[Chicago-talk] Why does Perl hate my csv file?

Eric Ellington e.ellington at gmail.com
Thu Dec 13 20:07:50 PST 2007


I am creating everything on a windows system. I checked the line
endings and they look OK to me. Like I said the file works with any
other extension besides csv. Giving it .123 worked.

The output is jacked up in the windows cmd terminal, all of the output
is printed on the same line. I can watch it overwrite it self and then
I just get some data smashed
onto one line.

Cut and Pasted:
,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000

This is a scaled down version of something larger. However, I am
having the exact same problem with the code I posted and I am just
testing with a different file which I attached to this email. If there
are any weird characters I am not sure what they are or how they are
messing things up. I see nothing but CR's on every line and one LF on
the final line.

I also turned on use warnings but got no warnings.

On Dec 13, 2007 6:49 PM, Andy Lester <andy at petdance.com> wrote:
>
> On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote:
>
> > Change the file name to 1.txt and I get output or if I comment out "my
> > $x = <FILE>;" and even then the output is jacked up. Why is that? Does
> > open do something special when it sees a file that ends in .csv? I
> > found nothing at http://perldoc.perl.org/functions/open.html or on
> > ActiveState's website.
>
>
> No, Perl doesn't care at all.  There's something else going on that
> you're not describing.  Are the line-endings different for your
> machine from the machine that you got the file from?  You're on Unix
> and it came from Windows, or vice versa?
>
> Also, although "use strict" is a good thing, even more important is
> "use warnings".
>
> Throw that in and see what else happens.  And what does "the output is
> jacked up" mean, anyway?
>
> xoox,
> Andy
>
> --
> Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance
>
>
>
>
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>



-- 
Eric Ellington
e.ellington at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.csv
Type: application/vnd.ms-excel
Size: 1632 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071213/2c40f80d/attachment.xlb 


More information about the Chicago-talk mailing list