Computer Science
Is csv file different from a text file ? Why/why not ?
Python File Handling
2 Likes
Answer
A CSV (Comma-Separated Values) file is a specific type of text file. The similarities and differences of CSV files with text files are as follows :
The similarities :
- Both are text-based formats.
- Both store data in a human-readable format.
- Both use plain text characters to represent data.
- Both are platform independent.
The differences :
- CSV files have a structured format where data is organized into rows and columns, separated by delimiters such as commas, tabs, or semicolons. Text files, on the other hand, can have any structure, and data may not be organized into rows and columns.
- CSV files are specifically designed for storing tabular data, such as spreadsheets, where each row represents a record and each column represents a field. Text files can contain any type of textual information.
- CSV files use delimiters (such as commas, tabs, or semicolons) to separate values within each row, while text files do not use delimiters.
Answered By
1 Like
Related Questions
When a file is opened for output in append mode, what happens when
(i) the mentioned file does not exist
(ii) the mentioned file does exist.
How many file objects would you need to create to manage the following situations ? Explain.
(i) to process three files sequentially
(ii) to merge two sorted files into a third file.
Is csv file different from a binary file ? Why/why not ?
Why are csv files popular for data storage ?