PIServer.ImportCsv Method (PIImportMode, CultureInfo, String, EventHandler(AFProgressEventArgs))
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Imports the comma-separated value (CSV) representation of PI Points, PI DigitalStateSets, PI Identities, or PI IdentityMappings
from a file.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public int ImportCsv( PIImportMode importMode, CultureInfo culture, string csvData, EventHandler<AFProgressEventArgs> handler )
Public Function ImportCsv ( importMode As PIImportMode, culture As CultureInfo, csvData As String, handler As EventHandler(Of AFProgressEventArgs) ) As Integer Dim instance As PIServer Dim importMode As PIImportMode Dim culture As CultureInfo Dim csvData As String Dim handler As EventHandler(Of AFProgressEventArgs) Dim returnValue As Integer returnValue = instance.ImportCsv(importMode, culture, csvData, handler)
public: int ImportCsv( PIImportMode importMode, CultureInfo^ culture, String^ csvData, EventHandler<AFProgressEventArgs^>^ handler )
member ImportCsv : importMode : PIImportMode * culture : CultureInfo * csvData : string * handler : EventHandler<AFProgressEventArgs> -> int
Parameters
- importMode
- Type: OSIsoft.AFPIImportMode
One or more of the PIImportMode values which indicates how to import. - culture
- Type: System.GlobalizationCultureInfo
The culture-specific settings to be used for conversion of times, dates, floating-point values, etc. If , the current culture will be assumed. If the invariant culture is specified, then DateTime's will be assumed to be in UTC time. - csvData
- Type: SystemString
The fully-qualified pathname to a file containing the CSV data or the CSV data itself. If the CSV data is passed in a string to ImportCsv, each line should be terminated by a carriage return and newline. - handler
- Type: SystemEventHandlerAFProgressEventArgs
Event handler method that will be called after each line of the CSV data is processed. If , import will occur silently.
Return Value
Type: Int32Returns the number of items updated or created.
Remarks
The CSV representation of the PI Points, PI DigitalStateSets, PI Identities, or PI IdentityMappings.
are imported into the PI Data Archive that is the target of the method call.