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

project file on csv files and text files

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 10

CENTRAL

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

MENT under their mentorship. I am grateful to


my parents for their unwavering support
and belief in my abilities. I would also
like to acknowledge the assistance
provided by the school administration
and staff. Their cooperation and
provision of resources have greatly
contributed to the successful execution
of this project. Lastly, I am deeply
grateful for the collective efforts and
support of everyone involved in this
school project. Thank you all for your
valuable contributions and for making
Presentation title this project a fulfilling and enriching3
Certificate
This is to certify that Samistha Choudhary of class XII
has successfully completed her inves- gory project on
the topic “ Text files and CSV files” during academic
year 2024-25, as per the guidelines issued by the
central board of secondary education(CBSE).

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)

Writing Function write(): It writes writelines():It writes all


string”str” to file string in list as lines to
Presentation title referenced by file referenced by ---------- 6
EXAMPLE OF TEXT FILE

CODE Output of code

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

You might also like