Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSV Standard - Multiple Tables

Tags:

python

csv

I am working on a python project that does some analysis on csv files. I know there is no well-definedstandard for csv files, but as far as I understood the definition (https://www.rfc-editor.org/rfc/rfc4180#page-2), I think that a csv file should not contain more than one table. Is this thinking correct, or did I misunderstood the definitions?

How often do you see more than one table in csv's?

like image 297
Zweistein Avatar asked Apr 28 '26 00:04

Zweistein


1 Answers

You are correct. There is no universal accepted standard. The definition is written to suggest that each file contains one table, and this is by far the most common practice.

There's technically nothing stopping you from having more than one table, using a format you decide on and implement and keep consistent. For instance, you could parse the file yourself and use a line with 5 hyphens to designate a separate table.

However I wouldn't recommend this. It goes against the common practice, and you will eliminate the possibility of using existing CSV libraries to help you.

like image 97
tmdesigned Avatar answered Apr 30 '26 14:04

tmdesigned



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!