Hi Experts,
I have issue that my code is behaving strange that, if I import CSV UTF-8 file its completely behaving strange and taking wrong records. Its working only on Coma delimited file.
AsciiStreamIo file;
Array fileLines;
FileUploadTemporaryStorageResult fileUpload;
Counter counter = 0;boolean header = true; #OCCRetryCount; try { //Upload a file fileUpload = File::GetFileFromUser(classStr(CSVFileUploadTemporaryStorageStrategy)); file = AsciiStreamIo::constructForRead(fileUpload.openResult()); if (file) { if (file.status()) { throw error("@SYS52680"); } file.inFieldDelimiter(','); //separator file.inRecordDelimiter('\r\n'); } //Read a CSV File container rec; ttsbegin;
while(file.status() == IO_Status::Ok)
//while (!file.status())
{
counter++;
rec = file.read();
if (conLen(rec))
{
if(header == true)
{
header = false; //This CSV file will always have header
continue;} //My code info("Import Completed"); ttscommit;
Could you all please guide me on this issue.
Thanks,
Mark