Live File Processor Agent Example – In-Situ-4

<< Click to Display Table of Contents >>

Navigation:  Live > Agents > File Agents > File Processor > Examples >

Live File Processor Agent Example – In-Situ-4

This example uses an older Win-Situ version 4 file, that has a multi-line header, and separate date and time columns. (Also see the In-Situ-5 article for version 5 files.)

 

Add the In-Situ-4 settings below to the ST_CONFIG table using the Live File Processor widget.

 

Settings

 

OBJECT_TYPE

OBJECT_VALUE

STRING_VALUE

Description

In-Situ-4

dateTimeColumnHeaderRegex

Date

DT_LOGGER_DATUM.DATUM_UTC_DT date; column header text contains Date.

In-Situ-4

delimiters

 

The fields are separated by tabs.

In-Situ-4

folderWatcherPath

C:\EarthSoft\Live\In-Situ-4


In-Situ-4

headerLinesRegex

.*\nDate.*Time\n.*

The header has 3 lines that look like this:

1.Anything (.*)

2.Contains Date + anything (.*) + Time

3.Anything (.*)

In-Situ-4

loggerCodeHeaderLinesRegex
Groups

^Test name\s*:\s*(?'a'[^\t]*)

DT_LOGGER.LOGGER_CODE

In-Situ-4

seriesNameColumnHeaderRegex
Groups

(?(?=^\n)\n(?'a'.*)\(.*\).*\n|^(?'b'.*)\n)

DT_LOGGER_SERIES.SERIES_NAME;

e.g., 'Temperature\nCelsius\n---------------' => 'Temperature', or '\nET (min)\n------------' => 'ET'

In-Situ-4

seriesUnitColumnHeaderRegex
Groups

(?(?=^\n)\n.*\((?'a'.*)\).*\n|\n(?'b'.*)\n)

DT_LOGGER_SERIES.SERIES_UNIT;

e.g., 'Temperature\nCelsius\n---------------' => 'Celsius', or '\nET (min)\n------------' => 'min'

In-Situ-4

timeColumnHeaderRegex

Time

DT_LOGGER_DATUM.DATUM_UTC_DT time; column header text contains Time.

In-Situ-4

utcOffsetDefaultValue

-5

DT_LOGGER_DATUM.DATUM_UTC_DT = file dates and times + 5 hours (Eastern Standard Time; UTC – 5 hours; not adjusted for DST).

 

1.Start the agent and copy the following file to folder C:\EarthSoft\Live\In-Situ-4.

 

 

In-Situ Inc.        Troll

 

Report generated:        10/22/14        16:11:39

Report from file:        ...\SN11026 2012-03-27 120000 SHP-02-0841_3-12.bin

Win-Situ Version        4.533

 

Serial number:        00011026

Firmware Version        6.24

Unit name:        AB-CDE-01

 

Test name:                B-31

 

Test defined on:        03/27/12        10:22:13

Test scheduled for:        03/27/12        12:00:00

Test started on:        03/27/12        12:00:00

Test stopped on:        N/A        N/A

 

Data gathered using Linear testing

  Time between data points:      14400.0        Seconds.

  Number of data samples:        5498

 

TOTAL DATA SAMPLES        5498

 

Channel number [1]

 Measurement type:        Temperature

 Channel name:        OnBoard Temp

 

Channel number [2]

 Measurement type:        Pressure

 Channel name:        Water level

 Sensor Range:         15 PSIG.

 Sensor Offset:        0.000 psi

 Specific gravity:           1.000

 Mode:        TOC

 User-defined reference:          45.150        Feet H2O

 Referenced on:        test start

 Pressure head at reference:           3.015        Feet H2O

 

                 Chan[1]        Chan[2]

                 Temperature        Pressure

Date         Time         ET (sec)        Fahrenheit        Feet H2O

--------        --------        ------------        ---------------        ---------------

03/27/12        12:00:00                 0.0             60.91            45.150

03/27/12        16:00:00             14400.0             60.92            45.127

03/27/12        20:00:00             28800.0             60.91            45.127

 

 

2.The file's Unit name line contains the DT_LOGGER.LOGGER_CODE field. Find/add the logger row, for example:

 

LOGGER_CODE

LIVE_DATA_SOURCE

UTC_OFFSET_HRS

B-31

COMPUTER_NAME/C:/EarthSoft/Live/In-Situ-4

-5 (= utcOffsetDefaultValue)

 

3.The line that contains Date and Time is the second header line, and the line before and after it is also a part of the header. It contains the DT_LOGGER_DATUM.DATUM_UTC_DT columns, and the other columns are the series; they contain DT_LOGGER_SERIES.SERIES_NAMEs and DT_LOGGER_SERIES.SERIES_UNITs.

 

4.For each subsequent line:

a.For each series (each column, excluding Date and Time columns):

i.Find/add the series row for the SERIES_NAME and SERIES_UNIT.

ii.Add the datum row (e.g., for the first data line):

 

SERIES_NAME

DATUM_UTC_DT

DATUM_VALUE

SERIES_UNIT

ET

2012-03-27 17:00:00 (= 2012-03-27 12:00:00 - utcOffsetDefaultValue)

0.0

sec

Temperature

2012-03-27 17:00:00

60.91

Fahrenheit

Pressure

2012-03-27 17:00:00

45.150

Feet H2O