Creating a comma-separated value file

Comma-Separated Value (CSV) files are widely used across various systems. Although nowadays modern systems use XML formats for data exchange, CSV files are still popular because of the simplicity of their format.

Normally, the data in the file is organized so one line corresponds to one record, and each line contains a number of values normally separated by commas. Record and value separators could be any other symbol, depending on the system requirements.

In this recipe, we will learn how to create a custom comma-separated file from code. We will export a list of ledger accounts—the CSV format.

How to do it...

Carry out the following steps in order to complete this recipe:

  1. Open the AOT, and create a new class ...

Get Microsoft Dynamics AX 2012 Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.