0
$\begingroup$

I am not sure if this is the correct forum for this question, but... After so much time and usage of spreadsheets and data files in general, there is a need to cater for all types of files containing all sorts of characters used as a field separator. Why hasn't a universal separator character evolved so that no-one has to bother with tab vs. pipe vs. comma (with and without quoted fields) vs. whatever? You would think that there would be a dedicated key on the keyboard like the "Enter" button used for field separation that is non-printable and that would reduce the number of data file types to one (with the exception of proprietary formats).

$\endgroup$
13
  • 2
    $\begingroup$ This would probably be more appropriate in Programmers.SE. $\endgroup$ – DylanSp Feb 2 '16 at 13:54
  • 2
    $\begingroup$ If you had some universal separator, how would you write a file with fields containing said separator? This is related to the question of a bottle to contain the universal solvent, or an omnipotent being creating a stone so large it can't lift it. $\endgroup$ – vonbrand Feb 2 '16 at 14:56
  • $\begingroup$ Imagine that you write program and need separator: you pick one or would you start research to find the most popular? People who made this decisions were neither communicating nor cooperating. $\endgroup$ – Evil Feb 2 '16 at 15:11
  • 1
    $\begingroup$ This is clearly not a computer science question. Plus, I don't think it is a good question for SE at all: there simply is no good answer beyond "people don't care for the preferences of other people". $\endgroup$ – Raphael Feb 4 '16 at 19:53
  • 2
    $\begingroup$ Raphael has already given the historical answer: xkcd.com/927 But there is also a CS answer: how do you encode a record which itself is a list of records? $\endgroup$ – Gilles 'SO- stop being evil' Feb 4 '16 at 21:39
2
$\begingroup$

We could have a field separator, but we don't, because of historical reasons. Most of the characters are brought from the era of typewriters. So we have line-separator ^M and page-separator ^L, and we actually have record separator \037 and unit separator \038 which can be used as field separator. But in reality no one uses that. First if you have a text file like csv, you want to use separators which are visible like , : TAB or SPACE. If your file is binary you are free to do almost anything with it.

Now it is too late to have a universal field separator. You can have your own private field separator of your choice. Just don't use it in your fields too.

$\endgroup$
3
  • $\begingroup$ I guess csv got popular due to "special separators" mentioned above not being available for typing on the keyboard... $\endgroup$ – kaboom Feb 5 '16 at 9:41
  • $\begingroup$ Especially with a displayable separator (which as noted has significant value), one has the problem of escaping the separator when it is part of the record, which violates the desire for simply storing the record. (A non-displayable separator would generally be translated for display anyway.) (Russel's paradox as noted in Gilles' comment) $\endgroup$ – Paul A. Clayton Feb 5 '16 at 14:35
  • 1
    $\begingroup$ Commas are natural (already used in common language as a generic list item separator) and good enough without quoting for many uses. Using quotation marks to quote comma-containing records is also somewhat natural and avoids internal escaping. In different contexts commas (or quotation marks) are more common within records, so other separators avoid quoting problems. (One could also ask whether separators are more desirable than start and end marks.) $\endgroup$ – Paul A. Clayton Feb 5 '16 at 14:35

Not the answer you're looking for? Browse other questions tagged or ask your own question.