READ COMMA SEPARATED FILES : DYNAMIC AX CODE X++
PUBLIC VOID READCOMMAFILE()
{
CommaTextIo file;
container line;
#define.filename(@'C:\\accounts.csv')
#File
file = new CommaTextIo(#filename, #io_read);
if (!file || file.status() != IO_Status::Ok)
{
throw error("File cannot be opened.");
}
line = file.read();
while (file.status() == IO_Status::Ok)
{
info(con2Str(line, ' - '));
line = file.read();
}
}
No comments:
Post a Comment