Think about Loose Coupling | |
PerlMonks |
Re^5: parsing csv with Text::ParseWordsby afoken (Chancellor) |
on Oct 13, 2009 at 18:56 UTC ( [id://800956]=note: print w/replies, xml ) | Need Help?? |
As a rule of thumb, DOS, Windows, OS/2 and many internet protocols use CR+LF, classic Macs use CR only, Unix and its derivates including modern Macs and the remaining internet protocols use LF only. They all use ASCII. Things become worse on EBCDIC systems, typically made by IBM. See Newlines in perlport. Look at a hex dump of the export, it will surely help more than guessing.
This particular CSV file ends each line with two bytes 0x0D and 0x0A, which is equal to \015\012 on ALL platforms. If you read the file on a Unix-based system or in binary mode on a DOS-based system, you can also use \r\n. If you read the file in text mode on a DOS-based system, use only \n. You can get the same behaviour on Unix-based system using the :crlf PerlIO layer. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|