SimpleTextParser

Description

A parser interface to handle unformatted or unstructured text files, supporting:Uniform interface through #rowsDo:Specification of delimitersValidationsCSV (through CSVParser) and XML (through XPath)Installation:Installer ss project: 'XPath'; install: 'XPath'; project: 'SimpleTextParser'; install: 'SimpleTextParser'; install: 'SimpleTextParserTests'. Gofer new squeaksource: 'XPath'; package: 'XPath'; squeaksource: 'SimpleTextParser'; package: 'SimpleTextParser'; package: 'SimpleTextParserTests'; load.Usage:| 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 " ].

Details

Source
SqueakSource
Dialect
squeak (25% confidence)

Categories

UI / Graphics Testing Serialization
← Back to results