(Perl) CSV Enable Quotes
Explains the EnableQuotes property for the CSV class.
use chilkat();
# The CSV in this example contains this: test;"123;abc";xyz
$csv = chilkat::CkCsv->new();
# EnableQuotes is 1 by default, but we'll explicitly set to 1 here:
$csv->put_EnableQuotes(1);
$success = $csv->LoadFile("qa_data/csv/enableQuotes.csv");
# Show row 0, column 0
print $csv->getCell(0,0) . "\r\n";
# Show row 0, column 1
print $csv->getCell(0,1) . "\r\n";
# Show row 0, column 2
print $csv->getCell(0,2) . "\r\n";
# Output is:
# test
# 123;abc
# xyz
# -------------------------------------------
# Turn off EnableQuotes and see what happens:
$csv2 = chilkat::CkCsv->new();
$csv2->put_EnableQuotes(0);
$success = $csv2->LoadFile("qa_data/csv/enableQuotes.csv");
print $csv2->getCell(0,0) . "\r\n";
print $csv2->getCell(0,1) . "\r\n";
print $csv2->getCell(0,2) . "\r\n";
print $csv2->getCell(0,3) . "\r\n";
# Output is:
# test
# "123
# abc"
# xyz
|