About the file import example .CSV parser
- Last UpdatedNov 17, 2025
- 2 minute read
The following describes the example Comma separated values (CSV) parser found in sdk\MeasUtil.FileImportParser.ExampleCSVParser.
Although it is example code, a compiled version of the library comes with the install media. It can be used to load CSV files with minimal additional configuration.
Note: The CSV file must have a header row that provides the name of the columns to support the mapping from the file to the API parameters.
The measFileImportCVSParser.json file contains an array of parsing specifications that map a filename to column mappings and a write procedure. Each array element contains the following items outlined in the table.
|
Element |
Description |
|
fileCriteria |
A regular expression to match the file with the input routine. For example, “HMR*” would load HMR.<date>.txt files. |
|
delimiter |
A single character denoting the delimiter. This is set to “,” for commas, but can be set to any other character such as a tab. |
|
writeProcedure |
This is set to one of the routines in the following Understand the inputs to APIs for AVEVA Measurement Advisor contained in the AVEVA Measurement Advisor Developer documentation. Note: Not all the columns for the write procedure need to be specified. For example, if the volume column is in the file and the writeProcedure has a "volume" argument, then it does not have to be in the procedureArgs. |
|
procedureArgs |
|
Content provided in measFileImportCSVParser.json
{
"measFileImport": {
"CSVParser": [
{
"fileCriteria": "HMR*",
"delimiter": ",",
"writeProcedure": "writeReadingRawHy",
"procedureArgs": [
[ "name", "objName" ],
[ "dateTime", "localTime" ],
[ "userName", "USERNAME" ]
]
},
{
"fileCriteria": "DMR*",
"delimiter": ",",
"writeProcedure": "writeReadingRawDy",
"procedureArgs": [
[ "name","objName" ],
[ "dateTime", "localTime" ],
[ "userName", "USERNAME" ]
]
}
]
}
}