Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: The future of Text::CSV_XS - TODO

by Tux (Monsignor)
on Dec 25, 2010 at 10:53 UTC ( #879144=note: print w/ replies, xml ) Need Help??


in reply to The future of Text::CSV_XS - TODO

Here's my X-Mas present:

0.80 - 2010-12-24

  • Implement getline_all () and getaline_hr_all ()
  • Fixed another parsing for eol = \r (RT#61525)

0.79 - 2010-11-26

  • Use correct type for STRLEN (HP-UX/PA-RISC/32)
  • More code coverage
  • EOF unreliable when line-end missing at eof

0.78 - 2010-11-26

  • Version 0.77 broke MacOS exported CSV files with only \r

The two new methods:

  • getline_all
    $arrayref = $csv->getline_all ($io); $arrayref = $csv->getline_all ($io, $offset); $arrayref = $csv->getline_all ($io, $offset, $length);

    This will return a reference to a list of getline ($io) results. In this call, keep_meta_info is disabled. If $offset is negative, as with splice (), only the last abs ($offset) records of $io are taken into consideration.

    Given a CSV file with 10 lines:

    lines call ----- --------------------------------------------------------- 0..9 $csv->getline_all ($io) # all 0..9 $csv->getline_all ($io, 0) # all 8..9 $csv->getline_all ($io, 8) # start at 8 - $csv->getline_all ($io, 0, 0) # start at 0 first 0 rows 0..4 $csv->getline_all ($io, 0, 5) # start at 0 first 5 rows 4..5 $csv->getline_all ($io, 4, 2) # start at 4 first 2 rows 8..9 $csv->getline_all ($io, -2) # last 2 rows 6..7 $csv->getline_all ($io, -4, 2) # first 2 of last 4 rows
  • getline_hr_all
    $arrayref = $csv->getline_hr_all ($io); $arrayref = $csv->getline_hr_all ($io, $offset); $arrayref = $csv->getline_hr_all ($io, $offset, $length);

    This will return a reference to a list of getline_hr ($io) results. In this call, keep_meta_info is disabled.


Enjoy, Have FUN! H.Merijn


Comment on Re: The future of Text::CSV_XS - TODO
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://879144]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-09-19 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (145 votes), past polls