Constructor
new CSVBatchParser()
Parameters:
Name | Type | Description |
---|---|---|
opts.pathToFile |
string |
The path to the CSV file you want to parse. |
opts.workflowName |
string |
The name of the workflow through which you want to run all the bags. |
- Source:
Methods
_parse()
Parse CSV data from this.pathToFile. Throws exception if file does not exist or cannot be parsed.
- Source:
_parseTags() → {Array.<object>}
This returns a list of tags from the given entry object (which comes from one parsed line of the CSV file). Note that even the reserved names "Bag-Name" and "Root-Directory" are interpreted as tags (because it can't hurt to have that extra metadata).
Tag names in the column headers of the CSV file should be in the format file-name.txt/Tag-Name. Any tag names that omit the filename component before the slash will be set to the default file name "bag-info.txt".
- Source:
parseAll() → {Array.<JobParams>}
This returns an array of JobParams objects with each object representing one line in the CSV file. This will throw an exception if the CSV file doesn't exist or is not readable.
This method does not verify that the JobParams objects are valid. The caller should ensure that each object has a workflowName, a packageName, one or more files, and the appropriate tags.
- Source: