DataFlex
DataFlex
CSV Enable Quotes
Explains the EnableQuotes property for the CSV class.Chilkat DataFlex Downloads
Use ChilkatAx-win32.pkg
Procedure Test
Boolean iSuccess
Handle hoCsv
Handle hoCsv2
String sTemp1
Move False To iSuccess
// The CSV in this example contains this: test;"123;abc";xyz
Get Create (RefClass(cComChilkatCsv)) To hoCsv
If (Not(IsComObjectCreated(hoCsv))) Begin
Send CreateComObject of hoCsv
End
// EnableQuotes is True by default, but we'll explicitly set to True here:
Set ComEnableQuotes Of hoCsv To True
Get ComLoadFile Of hoCsv "qa_data/csv/enableQuotes.csv" To iSuccess
// Show row 0, column 0
Get ComGetCell Of hoCsv 0 0 To sTemp1
Showln sTemp1
// Show row 0, column 1
Get ComGetCell Of hoCsv 0 1 To sTemp1
Showln sTemp1
// Show row 0, column 2
Get ComGetCell Of hoCsv 0 2 To sTemp1
Showln sTemp1
// Output is:
// test
// 123;abc
// xyz
// -------------------------------------------
// Turn off EnableQuotes and see what happens:
Get Create (RefClass(cComChilkatCsv)) To hoCsv2
If (Not(IsComObjectCreated(hoCsv2))) Begin
Send CreateComObject of hoCsv2
End
Set ComEnableQuotes Of hoCsv2 To False
Get ComLoadFile Of hoCsv2 "qa_data/csv/enableQuotes.csv" To iSuccess
Get ComGetCell Of hoCsv2 0 0 To sTemp1
Showln sTemp1
Get ComGetCell Of hoCsv2 0 1 To sTemp1
Showln sTemp1
Get ComGetCell Of hoCsv2 0 2 To sTemp1
Showln sTemp1
Get ComGetCell Of hoCsv2 0 3 To sTemp1
Showln sTemp1
// Output is:
// test
// "123
// abc"
// xyz
End_Procedure