CSV File Notes
CSV File Notes
CSV FILES
Monday , 11.09.2023
• import csv module
• Open / Close csv file,
• Write into a csv file using csv.writer()
• Read from a csv file using csv.reader( )
CSV files
• CSV (Comma Separated Values) is a simple file format used to store tabular data ( such as a
spreadsheet or database ) in plain text.
• Files in the CSV format can be imported to and exported from programs that store data in tables,
such as Microsoft Excel or OpenOffice Calc.
• Comma-separated file is a delimited text file that uses a comma to separate values.
• To perform read and write operation with CSV file, we must import csv module.
• CSV module can handle CSV files correctly regardless of the operating system on which the files were
created.
ACTIVITY D2
1. WAP to append data to a CSV file ‘Payroll.csv’ that must contain the employee details – EmpNo, Name and
Salary. The column heading must be given at the start.