Tab delimited vs Comma-separated values for text db
Wanted to know what people thought or if someone could point pros and cons out about the two.
I am creating a simple text driving application for a school project, and one of the requirements is to have a database. To limit system requirements for my application, I want to use a simple .txt file, but I am unsure which format to use. I would like to have a format that is vendor neutral and cross platform, which I am achieving by using “C” to program my application.
What format would you use? Again can you please provide pros and cons of the two types and why have chosen the format.
Thank you,
I am creating a simple text driving application for a school project, and one of the requirements is to have a database. To limit system requirements for my application, I want to use a simple .txt file, but I am unsure which format to use. I would like to have a format that is vendor neutral and cross platform, which I am achieving by using “C” to program my application.
What format would you use? Again can you please provide pros and cons of the two types and why have chosen the format.
Thank you,
Arrakis
Comments
-
JDMurray Admin Posts: 13,089 AdminThe problem is making sure that whatever character(s) you use for the field delimiters do not also appear in the record data. Tabs are good for numerical-only data because commas may be used in numbers, but both commas and tabs may appear in string data. I, personally, prefer using the ANSI group, record, and unit separator characters (35h, 36h, 37h), or the vertical bar, tilde, and circumflex characters. It all depends on the characters that may possibly appear in the record's fields.
If you want to achieve true portability and vendor neutrally, use XML. This is what XML was invented for. -
datchcha Member Posts: 265JDMurray wrote:The problem is making sure that whatever character(s) you use for the field delimiters do not also appear in the record data. Tabs are good for numerical-only data because commas may be used in numbers, but both commas and tabs may appear in string data. I, personally, prefer using the ANSI group, record, and unit separator characters (35h, 36h, 37h), or the vertical bar, tilde, and circumflex characters. It all depends on the characters that may possibly appear in the record's fields.
If you want to achieve true portability and vendor neutrally, use XML. This is what XML was invented for.
I do not know how to code my application to export in XML format at this momment, but you have given me a great idea. thank you.Arrakis