Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Measurement Advisor

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

  • To map a column from the CSV file to a parameter from the associated write procedure:

    [ "name", "objName" ]

  • If a parameter from the associated write procedure needs to be defined and is not contained within the file, you can add a row to the procedureArgs to define this. The first element in this case is the parameter name and the second element is the value.

    Consider the following examples:

    • Default the parameter to the fileImportUserName from the File Import Summary.

      [ "userName", "USERNAME" ]

    • Default the parameter to NULL.

      [ "nullColumn", "NULL" ]

    • Default the parameter to a number:

      [ “energy”, “777.7” ]

    • Default the parameter to a string:

      [ “editStateName”, “Edited” ]

  • You can skip a column from the CSV file that can not be mapped to the associated write procedure or if it contains data that you do not want to import:

    = [ “removeThis”, “N/A” ]

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" ]

]

}

]

}

}

TitleResults for “How to create a CRG?”Also Available in