Is there a way to add a "tag" (add a unique metadata/identifier) to a CSV file without affecting the contents or ability to read/write the file?
I am using Python, but I don't think the language matters here.
Many "CSV" files embed metadata, for example in lines before the header row of the CSV document. This specification does not define any formats for embedding metadata within CSV files, aside from the names of columns in the header row.
CSV on the Web is a World Wide Web Consortium (W3C) standard for describing parts of tabular data, including cells, rows and columns. By using CSVW, government organisations can: more easily process CSVs into an annotated data model. make CSVs easy to share and collaborate on. make CSVs machine-readable.
Just add comment lines that you can parse later.
#Creator:JohnSmith
#Date:....
#Columns:id,username,...
1,JohnSmith
2, ..
This would be compliant with W3C embedded metadata format: http://www.w3.org/TR/tabular-data-model/#embedded-metadata
#publisher,W3C
#updated,2015-10-17T00:00:00Z
#name,sensor,temperature
#datatype,string,float
sensor,temperature
s-1,25.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With