Interview Questions

Tuesday, September 27, 2016

Reading a CSV file In Dynamics AX

static void CSVtoAX(Args _args)
{
    #File
    CommaTextIo        commaTextIo;
    FileIOPermission   permission;
    container          containFromRead;
    int                x;
    int                cols;
    ;
    commaTextIo = new CommaTextIO('u:\\items.csv',#io_read);
    commaTextIo.inFieldDelimiter(';');
    containFromRead = commaTextIo.read();
    While(containFromRead)
    {
        cols = conLen(containFromRead);
        for(x=1;x<=cols;x++)
        {
            print conpeek(containFromRead,x);
        }
        containFromRead = commaTextIo.read();
    }
    pause;
    commaTextIo = null;
}

No comments:

Post a Comment