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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to read data from a csv file which has Sheet1,Sheet2,Sheet3 through x++

(0) ShareShare
ReportReport
Posted on by

Hi ,

I have a csv file with thre sheets in it namle "Default warehouse","Vendors","Cutomers".

Now my requirement is to read data from all the three sheets above in the CSV file.

Please let me know how could I do this via x++ code.

Regards,

Mania

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    A CSV file is also referred as a flat file. That means it is a single "table" and there are no "sheets" which would assume multiple tables, it only has columns and rows.

    Reading the file is possible in many different ways, but my preference would be to use the .Net namespaces with System.IO.StreamReader for which you could find a lot of examples online even for AX.

  • Community Member Profile Picture
    on at

    Thank you vilmos. Can you please give me some sample code for this Please ?

  • Community Member Profile Picture
    on at

    Vilmos please give me sample code , how could I get data from second sheet  from my CSV file.

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    Like Vilmos said, There are lot of examples on internet. Please use search Engine. I found one of blog , please look at this:

    www.tech.alirazazaidi.com/reading-csv-files-in-dynamics-ax-2012

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Here you go:

    lmgtfy.com

  • Don Shields Profile Picture
    650 on at

    In AX you can use commaio or ASCIItxtio classes to do this.  As mentioned earlier Excel will only save the current sheet as a csv.  The csv will not include all 3 sheets.

    Don[quote user="Microsoft Mania"]

    Hi ,

    I have a csv file with thre sheets in it namle "Default warehouse","Vendors","Cutomers".

    Now my requirement is to read data from all the three sheets above in the CSV file.

    Please let me know how could I do this via x++ code.

    Regards,

    Mania

    [/quote]

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans