Text::ECSV

Extended CSV manipulation routines
Download

Text::ECSV Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jozef Kutej
  • Publisher web site:
  • http://search.cpan.org/~jkutej/

Text::ECSV Tags


Text::ECSV Description

Extended CSV manipulation routines Text::ECSV is a Perl module for extended CSV manipulation routines.use base 'Text::CSV_XS'; => see Text::CSV_XS.Roland Giersig had a presentation at YAPC 2007 called 'Techniques for Remote System-Monitoring'. He was explaining his search after a good logging format or how to store continuous flow of data in a most usable form. XML? YAML? CSV? XML is nice but for a machines not for humans, YAML is nice for both but it's hard to grep. CSV is readable and grep-able but not too flexible. So what is the conclusion? ECSV is like a CSV but in each comma separated field the name of the column is set. This gives a flexibility to skip, reorder, add the fields. All the information is stored per line so it's easy to grep. Also it's easy to compare two records by md5-ing the lines or doing string eq.SYNOPSIS use Text::ECSV; $ecsv = Text::ECSV->new (); # create a new object $line = 'id=3,name=Text::ECSV,shot_desc=Extended CSV manipulation routines'; $status = $ecsv->parse ($line); # parse a CSV string into fields # and name value pairs %columns = $ecsv->fields_hash (); # get the parsed field hash $column = $ecsv->field_named('id'); # get field value for given name $ecsv->combine('b' => 2, 'a' => 1, 'c' => 3, ); # ok($ecsv->string eq 'b=2,a=1,c=3'); Requirements: · Perl


Text::ECSV Related Software