CSV File Formats

The format for a CSV file is as follows:

*Comments

[Command]

Header (Keywords)

values (separated by commas)

*Comments

where Command = [Tags], [Data], [Messages], or [Alarms] and Keywords = (see the following list).  Please note that the order of the data must match the order in the header.  For example, if you are importing a tagname, timestamp, value, and quality you would use the following syntax:

[Data]

Tagname,TimeStamp,Value,DataQuality

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good

Data values for a single entry should be kept on one line.

While importing an Alarm and Event only the following headers are considered.

The following table lists the available header keywords:

DataQuality

Value

Tagname

Description

EngineeringUnits

Comment

DataType

StringLength

StoreMilliseconds

CollectorName

CollectorType

SourceAddress

CollectionType

CollectionInterval

CollectionOffset

CollectionDisabled

LoadBalancing

TimeStamp

Type

TimeZoneBias

HiEngineeringUnits

LoEngineeringUnits

InputScaling

HiScale

LoScale

CollectorCompression

CollectorDeadbandPercentRange

CollectorCompressionTimeout

ArchiveCompression

ArchiveDeadbandPercentRange

ArchiveCompressionTimeout

Timeout

CollectorGeneral1

CollectorGeneral2

CollectorGeneral3

CollectorGeneral4

CollectorGeneral5

ReadSecurityGroup

WriteSecurityGroup

AdministratorSecurityGroup

Calculation

CalculationDependencies

CalculationExecutionTime

StepValue

Acked

Condition

SubCondition

EventCategory

Message

Source

Severity

StartTime

EndTime

TimestampType

SpikeLogic

SpikeLogicOverride

InterfaceAbsoluteDeadband

InterfaceAbsoluteDeadbanding

LastModified

LastModifiedUser

ArchiveAbsoluteDeadband

ArchiveAbsoluteDeadbanding

StepValue

Value

NumberOfElements

CalcType

NOTES:

You cannot import Last Modified User, Last Modified Date, and Calculation Execution Time fields on a tag.

Example of CSV File that Imports Tags

* This is a comment

*

[Tags]

Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits

TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0

TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0

TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0

TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0

TIGER.IMPORT_TAG5.F_CV,Import Tag 5,SingleFloat,35000,0

TIGER.IMPORT_TAG6.F_CV,Import Tag 6,SingleFloat,35000,0

TIGER.IMPORT_TAG7.F_CV,Import Tag 7,SingleFloat,35000,0

TIGER.IMPORT_TAG8.F_CV,Import Tag 8,SingleFloat,35000,0

TIGER.IMPORT_TAG9.F_CV,Import Tag 9,SingleFloat,35000,0

TIGER.IMPORT_TAG10.F_CV,Import Tag 10,SingleFloat,35000,0

Example of a CSV File that Imports Data and Data Quality

* This is a comment

*

[Data]

Tagname,TimeStamp,Value,DataQuality

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:08,2,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:09,3,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:10,4,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:11,5,Bad

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:12,6,Bad

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:13,7,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:14,8,Bad

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:15,9,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:16,10,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:17,11,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:18,12,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:19,13,Bad

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:20,14,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:21,15,Good

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:22,16,Bad

TIGER.IMPORT_TAG1.F_CV,7/20/01 11:23,17,Good

Example of a CSV File that Imports Messages

[Messages]

TimeStamp,Topic,Username,MessageNumber,MessageString,Substitutions

28-Aug-2002 19:39:30.567,General,User1,0,A Test Message value 2 with milliseconds,,

28-Aug-2002 19:40:00.000,General,User1,0,A Test Message value 0,,

 

Example of a CSV File that Imports Tags with Step Values

[Tags]

Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits

TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0

TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0

TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0

TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0

TIGER.IMPORT_TAG5.F_CV,Import Tag 5,SingleFloat,35000,0

TIGER.IMPORT_TAG6.F_CV,Import Tag 6,SingleFloat,35000,0

TIGER.IMPORT_TAG7.F_CV,Import Tag 7,SingleFloat,35000,0

TIGER.IMPORT_TAG8.F_CV,Import Tag 8,SingleFloat,35000,0

TIGER.IMPORT_TAG9.F_CV,Import Tag 9,SingleFloat,35000,0

TIGER.IMPORT_TAG10.F_CV,Import Tag 10,SingleFloat,35000,0

Example of a CSV File that Imports Alarms

[Alarms]

DataSource,Condition,Source,StartTime,TimeStamp

FileCollector,HI,Mixer,3/10/2005 12:52:02,3/10/2005 12:52:02

FileCollector,HIHI,Mixer,3/10/2005 12:52:02,3/10/2005 12:59:12

 

Example of a CSV File that Imports Enumerated Set

[EnumeratedSet]

SetName,SetDescription,StateLowValue,StateHighValue,StateDescription,StateName,StateRawValueDataType,LastModified,LastModifiedUser,AdministerSecurityGroup,NumberOfStatesInThisSet

TestSet5,TestDesc,1,10,State1Desc,State1,DoubleFloat,,,,2

TestSet5,TestDesc,11,20,State2Desc,State2,DoubleFloat,,,,2

Example of a CSV File that Imports Array Tags

[Tags]

Tagname,Description,DataType,HiEngineeringUnits,LoEngineeringUnits,NumberOfElements

TIGER.IMPORT_TAG1.F_CV,Import Tag 1,SingleFloat,35000,0,-1

TIGER.IMPORT_TAG2.F_CV,Import Tag 2,SingleFloat,35000,0,0

TIGER.IMPORT_TAG3.F_CV,Import Tag 3,SingleFloat,35000,0,-1

TIGER.IMPORT_TAG4.F_CV,Import Tag 4,SingleFloat,35000,0,-1

Example of a CSV File that Imports Array Tag Data

[Data]

Tagname,TimeStamp,Value,DataQuality

ArrayTag[0],6/11/2013 09:00:00,1,Good

ArrayTag[1],6/11/2013 09:00:00,2,Good

ArrayTag[2],6/11/2013 09:00:00,3,Good

ArrayTag[3],6/11/2013 09:00:00,4,Good

ArrayTag[0],6/11/2013 09:10:00,5,Good

ArrayTag[1],6/11/2013 09:10:00,6,Good

ArrayTag[2],6/11/2013 09:10:00,7,Good

Example of a CSV File that Imports MultiField Tag Data

[Data]

Tagname,TimeStamp,Value,DataQuality

MultiField.F1,05-22-2013 14:15:00,4,Good

MultiField.F1,05-22-2013 14:15:01,7,Good

MultiField.F1,05-22-2013 14:15:02,9,Good

MultiField.F2,05-22-2013 14:15:00,241,Good

MultiField.F2,05-22-2013 14:15:01,171,Good

MultiField.F2,05-22-2013 14:15:02,191,Good

NOTE: Before importing MultiField tag data in this format, you should add the User Defined Type using Historian Administrator and associate that type to the MultiField tag.

Example of a CSV File that Imports Python Expression Tags

[Tag]

Tagname,CollectorName,CalcType,SourceAddress,DataType,Description

TagDerivedFromRawValue,SimulationCollector,PythonExpr,"{""imports"":[""math""],""script"":""tag.value + math.pow(10,tag.value/70)"",""parameters"":[{""name"":""tag"",""source"":{""address"":""Simulation00001"",""dataType"":""SingleFloat""}}]}",SingleFloat,Python Expression Tag example

NOTES:

For more information on these tags, refer to the Python Expression Tags ebook.

See Also

The File Collector

XML File Formats

Summary of File Collector Features

Collector-Specific Configuration (File)

How Do I

configure the File Collectors

configure the File Collector-Specific Fields

troubleshooting the File Collector