i got perl script not written by me which parses data files and write them to database.
One of the file i am having a issue is a csv file.The file is using CRLF terminators.
The script when i run throws an error "Something went wrong while parsing/importing " and it displays the line number.I have managed to diagnose there is LF in the middle of line and the normal CRLF in the end.
how can i remove this LF.I been told it is LF by notepad++
# parse, process and save data for further usage
my $fh = new IO::File;
my $ic_failed = 0;
my $ic_total = 0;
if ($fh->open($feed)) {
my $parser = Parse::CSV->new(
handle => $fh,
csv_attr => $csv_setup,
fields => $csv_fields,
filter => sub { retrievefiles($_) },
);
I have tried binary mode in $main::csv_setup but cant get it to read it..
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.