Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

This is a follow-up on my previous post on Text::CSV_XS

I have been digging a bit to find what people consider loose ends in Text::CSV_XS, and tried to summarize that (in no particular order) in the new TODO list. Here TODO gives no guarantee that it will be done, nor on any implementation or API that it might suggest, it is there now just so I/we do not forget to think about these issues.

I'd like to get thoughts/feedback/suggestions about items on this list, and how valuable you consider adding these features to a modules so heavily used by other applications.

jZed asked me to also post to this to the dbi-users list, cause many DBI users (have to) deal with CSV data, which I already did. So start shooting ...

TODO (updated to 0.80 on 25-12-2010)

More Errors & Warnings

New extensions ought to be clear and concise in reporting what error occurred where and why, and possibly also tell a remedy to the problem. error_diag is a (very) good start, but there is more work to be done here.

Basic calls should croak or warn on illegal parameters. Errors should be documented.

setting meta info

Future extensions might include extending the meta_info (), is_quoted (), and is_binary () to accept setting these flags for fields, so you can specify which fields are quoted in the combine ()/string () combination.

  $csv->meta_info (0, 1, 1, 3, 0, 0);
  $csv->is_quoted (3, 1);
combined methods

Requests for adding means (methods) that combine combine () and string () in a single call will not be honored. Likewise for parse () and fields (). Given the trouble with embedded newlines, Using getline () and print () instead is the preferred way to go.

Parse the whole file at once

Implement new methods that enable parsing of a complete file at once, returning a list of hashes. Possible extension to this could be to enable a column selection on the call:

   my @AoH = $csv->parse_file ($filename, { cols =>  1, 4..8, 12 });

Returning something like

   [ { fields => [ 1, 2, "foo", 4.5, undef, "", 8 ],
       flags  => [ ... ],
       errors => [ ... ],
       },
     { fields => [ ... ],
       .
       .
       },
     ]

Note that getline_all () already returns all rows for an open stream, but this will not return flags.

EBCDIC

The hard-coding of characters and character ranges makes this module unusable on EBCDIC system. Using some #ifdef structure could enable these again without loosing speed. Testing would be the hard part.


The most current state is available on the public GIT repo.


Enjoy, Have FUN! H.Merijn

In reply to The future of Text::CSV_XS - TODO by Tux

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others cooling their heels in the Monastery: (12)
    As of 2014-07-31 22:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (254 votes), past polls