<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">it seems that all line end with carriage return character (ascii octal num 15) only. There is no line feed (newline character in Unix)<br><br>I made one in Linux and you can see the difference:<br><br><span style="font-family: courier,monaco,monospace,sans-serif;">gpeng@linbay:/home/gpeng/perl</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">-&gt; perl&nbsp; -ne 'print $_' 2.csv</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span
 style="font-family: courier,monaco,monospace,sans-serif;">gpeng@linbay:/home/gpeng/perl</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">-&gt; perl&nbsp; -ne 'print $_,"\n"' 2.csv</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">gpeng@linbay:/home/gpeng/perl</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">-&gt; perl -015&nbsp; -ne 'print $_,"\n"' 2.csv&nbsp; # use carriage character as recorder separator</span><br style="font-family:
 courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">Header</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span
 style="font-family: courier,monaco,monospace,sans-serif;">WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,,</span><br style="font-family: courier,monaco,monospace,sans-serif;"><span style="font-family: courier,monaco,monospace,sans-serif;">WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,,</span><br><br><br>gpeng@linbay:/home/gpeng/perl<br><br><br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Eric Ellington &lt;e.ellington@gmail.com&gt;<br>To: Chicago.pm chatter &lt;chicago-talk@pm.org&gt;<br>Sent: Thursday, December 13, 2007 10:07:50 PM<br>Subject: Re: [Chicago-talk] Why does Perl hate my csv file?<br><br>
I am creating everything on a windows system. I checked the line<br>endings and they look OK to me. Like I said the file works with any<br>other extension besides csv. Giving it .123 worked.<br><br>The output is jacked up in the windows cmd terminal, all of the output<br>is printed on the same line. I can watch it overwrite it self and then<br>I just get some data smashed<br>onto one line.<br><br>Cut and Pasted:<br>,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000<br><br>This is a scaled down version of something larger. However, I am<br>having the exact same problem with the code I posted and I am just<br>testing with a different file which I attached to this email. If there<br>are any weird characters I am not sure what they are or how they are<br>messing things up. I see nothing but CR's on every line and one LF on<br>the final line.<br><br>I also turned on use warnings but got no warnings.<br><br>On Dec 13, 2007 6:49 PM, Andy Lester &lt;<a
 ymailto="mailto:andy@petdance.com" href="mailto:andy@petdance.com">andy@petdance.com</a>&gt; wrote:<br>&gt;<br>&gt; On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote:<br>&gt;<br>&gt; &gt; Change the file name to 1.txt and I get output or if I comment out
 "my<br>&gt; &gt; $x = &lt;FILE&gt;;" and even then the output is jacked up. Why is that?
 Does<br>&gt; &gt; open do something special when it sees a file that ends in .csv? I<br>&gt; &gt; found nothing at <a href="http://perldoc.perl.org/functions/open.html" target="_blank">http://perldoc.perl.org/functions/open.html</a> or on<br>&gt; &gt; ActiveState's website.<br>&gt;<br>&gt;<br>&gt; No, Perl doesn't care at all.&nbsp; There's something else going on that<br>&gt; you're not describing.&nbsp; Are the line-endings different for your<br>&gt; machine from the machine that you got the file from?&nbsp; You're on Unix<br>&gt; and it came from Windows, or vice versa?<br>&gt;<br>&gt; Also, although "use strict" is a good thing, even more important is<br>&gt; "use warnings".<br>&gt;<br>&gt; Throw that in and see what else happens.&nbsp; And what does "the output
 is<br>&gt; jacked up" mean, anyway?<br>&gt;<br>&gt; xoox,<br>&gt; Andy<br>&gt;<br>&gt; --<br>&gt; Andy Lester =&gt; <a ymailto="mailto:andy@petdance.com" href="mailto:andy@petdance.com">andy@petdance.com</a> =&gt; <a target="_blank" href="http://www.petdance.com">www.petdance.com</a> =&gt; AIM:petdance<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; Chicago-talk mailing list<br>&gt; <a ymailto="mailto:Chicago-talk@pm.org" href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>&gt; <a href="http://mail.pm.org/mailman/listinfo/chicago-talk" target="_blank">http://mail.pm.org/mailman/listinfo/chicago-talk</a><br>&gt;<br><br><br><br>-- <br>Eric Ellington<br><a ymailto="mailto:e.ellington@gmail.com" href="mailto:e.ellington@gmail.com">e.ellington@gmail.com</a><br></div><br></div></div></body></html>