project file on csv files and text files
project file on csv files and text files
project file on csv files and text files
Session 2024-25
BOARD
AISSC Exam
SECONDARY
Subject- Computer
Science(083)
EDUACTION
Submitted Submitted By:
to: Samistha
Miss.Saba Choudhary
Depts. CS 12th A
Rana
International
School
1.Aknowledment
2.Certificate
3.Index
4.About Text files
Index and CSV files
5. Text files
6. CSV files
7. Example of each
file
8. Remarks
Presentation title 2
I would like to express my sincere
gratitude to everyone who has
contributed to the completion of this
project: "Text files and CSV files “.
First and foremost, I want to thank my
school principal “Dr. S.V John” for
giving me this golden opportunity to
working on this project. I want to thank
ACKNOWLEG
my teacher, “Miss Saba "for their
continuous guidance, encouragement,
and expertise. I am grateful for the
knowledge and skills I have gained
Internal Examiner
Extremal Examiner
Principal
Presentation title 4
Text files and CSV files
Text files
A text files stores information in the form of a stream of ASCII or
UNICODE character. We can do different operations on these files such as
read, write, append(In write mode), read and write, write and read..
These operations works as their name suggests. These read and write
functions are further classified, i.e.,
Reading Function read(): It is used only readline(): It reads readlines(): It reads
to read the entire file if only one line ending all the lines and
specific bytes are not with character(‘/n’). returns them in a list.
mentioned otherwise Syntax: Syntax:
only specified bytes <filehandle>.readlines( >>>file1=open(“E\\
are read. n) data\\info.txt”)
Syntax:
<filehandle>.read(n)
Presentation title 7
CSV FILES
CSV files are delimited files that store tabular data. As CSV files are text files , so we can
apply text files procedure on these and then spilt values using spilt() function.
BUT the more easier method used in these are CSV modules i.e., import CSV.
We can perform similar functions on csv files like text files such as reading, writing and
opening a file.
Opening a csv files: --- Writing in csv files: ---- Reading csv files:---
Syntax: # csv.writer()- It returns a Reading from a csv files
defile=open(“stu.csv”,”w”) writer object which writes involves leading of a csv file
- w refers to data a into csv files. data.
write mode # <writerobejct>.writerow()- * csv.reader()- It returns a
file1= It writes a row of data into reader object which loads
open(“stu.csv”,”r”) the writer object. data from csv file.
- r refers to read
Presentation title # 8
EXAMPLE OF CSV FUNCTION
Q.) A program to create CSV file.
Presentation title 9
REMARKS
Thank
you