Until now, we've always read files and displayed them. In the final recipes of the chapter, we will show how to export the data that we have available inside the program. This can be useful if you want to allow further processing of the data in other programs.
For instance, imagine that you import and process data from a REST service. Users may want to take that data out of the application and use it in Excel to perform their own calculations or create a custom graph.
This recipe looks at exporting to the CSV format that can be used to load the data in Excel and other spreadsheet programs.
For this recipe, we will start from a simple data array, but of course the data could be coming from anywhere. ...