0% found this document useful (0 votes)
3 views7 pages

CS12 FileHandlingPythonPart3

This document provides an overview of file handling in Python, specifically focusing on CSV (Comma-Separated Values) files. It outlines the use of the csv module, including functions for opening, reading, and writing CSV files. Additionally, it explains how to create CSV files using spreadsheet applications like Excel and text editors like Notepad.

Uploaded by

vr418273
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

CS12 FileHandlingPythonPart3

This document provides an overview of file handling in Python, specifically focusing on CSV (Comma-Separated Values) files. It outlines the use of the csv module, including functions for opening, reading, and writing CSV files. Additionally, it explains how to create CSV files using spreadsheet applications like Excel and text editors like Notepad.

Uploaded by

vr418273
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

File Handling in Python

PART – III
(Based on .csv file)

1
In the Syllabus
CSV File:
✓Import csv module
✓functions – Open / Close a .csv file
✓Read from a csv file using csv.reader ( )
✓Write into a csv file using csv.writerow( )

2
What is CSV file (Comma-Separated Values)

✓ It is most commonly used file by spreadsheet and database


applications to transfer data.
✓ It contains tabular data in plaintext. Each line represents a table
record or table row.
✓ Each record contains fields which represent data for each column in
the table. The fields are separated by commas.

3
How to create a csv file in Spreadsheet
1. Open Excel
2. Type the table data.
3. Save the file as .CSV
4. Open the file in Notepad.
5. You will find the data separated by comma.

How to create a csv file in Notepad


1. Open Notepad
2. Type the table data.
3. Save the file as .CSV

4
Read data from .csv file

5
Write data to .csv file

Read Data from the .csv file Output 6


7

You might also like