static void readTextFile(Args _args)
{
Container con;
Filename filename, Filename2;
FileIOPermission permission;
TextIO textIO, textIO1;
Str1260 line;
#File
;
Filename = @"C:\Test\testFile.txt";
permission = new fileIOpermission(filename,"RW");
permission.assert();
textIO = new TextIO(filename,#io_read);
//textIO.inFieldDelimiter('|');
if(textIO)
{
while(textIO.status() == IO_Status::Ok)
{
con = textIO.read();
if(con)
{
line = Global::con2Str(con);
info(strFmt("text - %1",line));
info(strFmt("Company id - %1",subStr(line,1,4)));
info(strFmt("code - %1",subStr(line,5,6)));
info(strFmt("account num - %1",subStr(line,12,14)));
info(strFmt("transdate - %1",subStr(line,26,6)));
info(strFmt("Cheque num - %1",subStr(line,32,10)));
info(strFmt("amount - %1",subStr(line,42,8)));
break;
}
}
}
}
{
Container con;
Filename filename, Filename2;
FileIOPermission permission;
TextIO textIO, textIO1;
Str1260 line;
#File
;
Filename = @"C:\Test\testFile.txt";
permission = new fileIOpermission(filename,"RW");
permission.assert();
textIO = new TextIO(filename,#io_read);
//textIO.inFieldDelimiter('|');
if(textIO)
{
while(textIO.status() == IO_Status::Ok)
{
con = textIO.read();
if(con)
{
line = Global::con2Str(con);
info(strFmt("text - %1",line));
info(strFmt("Company id - %1",subStr(line,1,4)));
info(strFmt("code - %1",subStr(line,5,6)));
info(strFmt("account num - %1",subStr(line,12,14)));
info(strFmt("transdate - %1",subStr(line,26,6)));
info(strFmt("Cheque num - %1",subStr(line,32,10)));
info(strFmt("amount - %1",subStr(line,42,8)));
break;
}
}
}
}