web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

How to read CSV file in AX

Muhammad Yasir Profile Picture Muhammad Yasir 1,023
    #file
    CommaTextIo       commaTextIo;      
    fileiopermission     permission;
    container              c;
    int                        x;
    int                        cols;

    permission = new fileiopermission('c:\\test.csv',#io_read);
    permission.assert();

    // specify the source file name ie. "test.csv"
    commaTextIo = new CommaTextIo('c:\\test.csv','r');
    c = commaTextIo.read();

    while(c)
    {
        cols = conlen(c);
        for(x = 1; x <= cols; x++)
        {
              info (any2str(conpeek(c,x)));
        }
        c = commaTextIo.read();
   }

   commaTextIo = null;

This was originally posted here.

Comments

*This post is locked for comments