static void samplecsv(Args _args)
{
CommaTextIO csvFile;
container readCon;
counter icount,inserted;
Dialog dialog;
DialogField dfFileName;
FileName fileName;
ItemId itemId;
#File
//Sangeeth added
dialog = new Dialog("Pick the file");
dfFileName = dialog.addField(extendedTypeStr("FilenameOpen"));
dialog.filenameLookupFilter(["All files", #AllFiles]);
if (dialog.run())
{
csvFile = new CommaTextIo(dfFileName.value(), 'r');
csvFile.inFieldDelimiter(',');
readCon = csvFile.read();
ttsBegin;
while(csvFile.status() == IO_Status::OK)
{
readCon = csvFile.read();
if(readCon)
{
icount++;
itemId = conPeek(readCon,1);
info(itemId);
}
}
ttsCommit;
}
}
{
CommaTextIO csvFile;
container readCon;
counter icount,inserted;
Dialog dialog;
DialogField dfFileName;
FileName fileName;
ItemId itemId;
#File
//Sangeeth added
dialog = new Dialog("Pick the file");
dfFileName = dialog.addField(extendedTypeStr("FilenameOpen"));
dialog.filenameLookupFilter(["All files", #AllFiles]);
if (dialog.run())
{
csvFile = new CommaTextIo(dfFileName.value(), 'r');
csvFile.inFieldDelimiter(',');
readCon = csvFile.read();
ttsBegin;
while(csvFile.status() == IO_Status::OK)
{
readCon = csvFile.read();
if(readCon)
{
icount++;
itemId = conPeek(readCon,1);
info(itemId);
}
}
ttsCommit;
}
}
No comments:
Post a Comment