Read content of a CSV file to a DataGridView object.

Namespace: ExpSuite
Assembly: FrameWork (in FrameWork.exe) Version: 1.0.0.0

Syntax

Visual Basic
Public Function ReadDGV ( _
	szFile As String, _
	ByRef dgvDest As DataGridView, _
	pbStatus As ProgressBar _
) As String

Parameters

szFile
Type: System..::..String
File name of the CSV file.
dgvDest
Type: System.Windows.Forms..::..DataGridView%
Datagridview object as destination for the data.
pbStatus
Type: System.Windows.Forms..::..ProgressBar
Progress bar to show the progress of parsing.

Return Value

Error message, empty if no error ocured.

Remarks

Rules (if " is Quota and , is Separator):
  • " : mszQuota
  • , : Separator
  • row : cell,cell,cell
  • not quoted cells:
  • ab,cd -> two cells: ab and cd
  • ab"cd -> ab"cd
  • ab""cd -> ab""cd
  • ab" -> ab"
  • ab"" -> ab""
  • quoted cells:
  • "ab" -> ab
  • "ab,cd" -> ab,cd
  • "ab"cd -> ab and ignore cd
  • "ab"de" -> ab and ignore cd
  • ""abcd -> empty cell and ignore abcd
  • "ab""cd" -> ab"cd
  • "ab"",cd" -> ab"cd
  • """abcd" -> "abcd
  • last quoted cell in a row:
  • "abEOL -> ab
  • "ab"EOL -> ab
  • "ab""EOL -> ab"
  • "ab"""EOL -> ab"
  • "ab""cdEOL -> ab"cd
  • Empty row -> one empty cell
  • See Also