Text::LooseCSV

Text::LooseCSV is a highly forgiving variable length record text parser; compare to MS Excel.
Download

Text::LooseCSV Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Reed Sandberg
  • Publisher web site:
  • http://search.cpan.org/~rsandberg/Text-LooseCSV-1.6/lib/Text/LooseCSV.pm

Text::LooseCSV Tags


Text::LooseCSV Description

Text::LooseCSV is a highly forgiving variable length record text parser; compare to MS Excel. Text::LooseCSV is a highly forgiving variable length record text parser; compare to MS Excel.SYNOPSIS use Text::LooseCSV; use IO::File; $fh = new IO::File $fname; $f = new Text::LooseCSV($fh); # Some optional settings $f->word_delimiter("t"); $f->line_delimiter("n"); $f->no_quotes(1); # Parse/split a line while ($rec = $f->next_record()) { if ($rec == -1) { warn("corrupt rec: ", $f->cur_line); next; } # process $rec as arrayref ... } # Or, (vice-versa) create a variable-length record file $line = $f->form_record( );Why another variable-length text record parser? I've had the privilege to parse some of the gnarliest data ever seen and everything else I tried on CPAN choked (at the time I wrote this module). This module has been munching on millions of records of the filthiest data imaginable at several production sites so I thought I'd contribute.This module follows somewhat loose rules (compare to MS Excel) and will handle embedded newlines, etc. It is capable of handling large files and processes data in line-chunks. If MAX_LINEBUF is reached, however, it will mark the current record as corrupt, return -1 and start over again at the very next line. This will (of course) process tab-delimited data or whatever value you set for word_delimiter.Methods are called in perl OO fashion.WARNING this module messes with $/ line_delimiter sets $/ and is always called during construction. Don't change $/ during program execution! Requirements: · Perl


Text::LooseCSV Related Software