Hello all,
www.tech.alirazazaidi.com/.../
with reference to above post I have written the code but I am getting error that is in screenshot attached.
I am using runbase batch for the file selection and getting the file also.
The code I have written is
public void importCsvFile(Args _args)
{
#File
CommaTextIo csvFile;
Name FirstName;
Name LastName;
StudentInfo studentInfo;
//FilenameOpen filenameOpen; //= “c:\\StudentInfo.csv”;//To assign file name
Container record;
boolean first = true;
;
csvFile = new CommaTextIo(filenameOpen, #IO_Read); // csvFile is getting null value here in this par and the filenameOpen is having the file name.
if (! csvFile || csvFile.status() != IO_Status::Ok)
{
throw error("@SYS19358");
}
while (csvFile.status() == IO_Status::Ok)
{
record = csvFile.read();// To read file
if (record)
{
if (first) //To skip header
{
first = false;
}
else
{
FirstName = conpeek(record, 1);//To peek record
LastName = conpeek(record, 2);
_StudentInfo.FirstName =FirstName;
_StudentInfo.LastName =LastName;
_StudentInfo.insert();
}
}
}
}

How can I read the csv file or what is the mistake in this part of code.
*This post is locked for comments
I have the same question (0)