TabularReader
Synopsis
Reads a tabular file and applies actions for each line.
Description
TabularReader reads source as a tabular file and for each line evaluates each lineActions .
Snippet
<tabularreader class="TabularReader">
<lineActions></lineActions>
<source></source>
<sourceElement></sourceElement>
</tabularreader>
Mandatory parameters
lineActions
Action expressions to evaluate at each row. The expressions are evaluated from the element specified by sourceElement .
The library tab
defines the following functions:
tab:column(N)
: value of the Nth column.tab:field:NAME
ortab:field(NAME)
: value of the column named NAME (requires header set to truetab:source
: name of the input source being parsed.tab:line
: current row number.tab:width
: number of column in the current row.
source
Source of CSV. Maybe a path to a file or an URL
sourceElement
For each source, this expression is evaluated as a single element from the corpus. lineActions will be evaluated from this element.
Optional parameters
checkNumColumns
Either to check that all rows have the same number of columns. The execution will fail if one row has a wrong number of columns.
constantAnnotationFeatures
Constant features to add to each annotation created by this module.
constantDocumentFeatures
Constant features to add to each document created by this module.
constantRelationFeatures
Constant features to add to each relation created by this module.
constantSectionFeatures
Constant features to add to each section created by this module.
constantTupleFeatures
Constant features to add to each tuple created by this module.
addToLayer
Allow to add annotations to layers.
commitLines
Commit changes at each line.
createAnnotations
Allow the creation of annotations.
createDocuments
Allow the creation of documents.
createRelations
Allow the creation of relations.
createSections
Allow the creation of sections.
createTuples
Allow to create tuples.
deleteElements
Allow to delete elements.
header
Either to skip the first row.
removeFromLayer
Allow to remove annotations from layers.
separator
Column separator character.
setArguments
Allow to set tuple arguments.
setFeatures
Allow to set element features.
skipBlank
Either to skip blank lines.
trimColumns
Either to trim values from leading and trailing whitespace
trueCSV
Use CSV Commons library (handles quoted values).