Happy !

hernan / CSV

Project infos

License MIT
Tags csv, parser
Creation date 2013-07-07
Website

Monticello registration

About CSV

Description

A parser interface to handle CSV files for Pharo. Supports uniform interface through #rowsDo: and variants, delimiter specification and validations. If looking for speed you should try NeoCSV first.

Installation

Gofer it
  smalltalkhubUser: 'hernan' project: 'CSV';
  package: 'SimpleTextParser';
  package: 'SimpleTextParserTests';
  load.

Examples

| string |
string := ... " a CSV delimited string ".
parser := (STextParser on: string) delimiter: $;.
parser rows.
parser numRows.
parser numFields.
parser rowsDo: [: row | " perform some action for row " ].
parser rowsSkipFirst: 2 do: [: row | " some action ignoring first 2 fields on each row " ].
parser rowsSkipLast: 2 do: [: row | " some action ignoring last 2 fields on each row " ].