Now that you have a good handle on reading and writing to files, let's talk about how to deal with more structured data. In real-world applications, you will most likely have to read data in a structured format.
Do you remember the payroll application we talked about in the beginning of this chapter? Such data could be represented in a CSV file. A CSV file is a file with comma-separated values, usually arranged in columns.
Such data can then be easily read into a spreadsheet application, such as Excel, and manipulated there. Python provides a utility to work with CSV files, which we will cover in this topic.
Here is an example of a CSV file:
Name,City "Nash, Colorado B.",Milton Keynes "Herrera, Chase E.",Gentbrugge "Hubbard, Leilani I.",Bremen "Vinson, Marsden H.",Lakeland County "Macias, Lawrence E.",Noisy-le-Grand … … "Phelps, Amity V.",Morena "Woods, Jaden V.",Portland "Hyde, Duncan P.",Schellebelle "Hendricks, Yoshio V.",Sperlinga "Delgado, Emma T.",Reyhanlı "Oneil...