Is it a good idea to use double dots or double minus signs as the delimiters? I'm trying to find a good naming convention for experimental scientific data. For example:
2017-12-11T19-45..JDoe-042..UO2(NO3)2-EtOAc_dist..150.3K..1.234mM.dat
2017-12-11T19-45--JDoe-042--UO2(NO3)2-EtOAc_dist--150.3K--1.234mM.dat
My reasons:
- To assure compatibility across platforms, the only suitable characters are
_
-
.
and their combinations; - None of them can be used on their own in my case:
_
is reserved for the spaces; due to case-sensitive chemical formulas I cannot use camelCase.-
is often a part of internal lab codes, plus it's being used as a replacement for a colon:
in time (modified ISO 8601 notation) and ratios;.
is a decimal mark.
- Among their combinations the most popular, it seems, is
_-_
. However, this is 3 characters and the filenames are already pretty lengthy (as one can tell from the examples), so I'd like to stick with two characters if possible. - Visually I find it's hard to quickly tell the difference between
__
and_
, whereas--
vs-
and.
vs..
are quite distinguishable to me. - I haven't included comma
,
(as it has been rightfully suggested in the comments, this is also a viable character to consider) as I think it's easy to confuse it with a single dot.
, which is already primarily reserved for the numerical values with a decimal point.
According to several posts across SE network, e.g.
- Are periods (“.”) valid characters in file or folder names?
- Is it bad practice for folder name to contain dot (.)? How about file name with multiple dots?
- Should file names contain multiple periods?
I would assume both --
and ..
are totally acceptable, and I'm thinking of finally choosing ..
. However, I'm not certain, especially regarding how regular expressions or python scripts can handle these files and folders (I have very little experience with both, but I'm learning).
Disregarding the behavior of specialized software, would you say these delimiters are generally safe for common file systems and scripting languages?
.
from the numerical values can be easily confused with a comma,
, so I dropped this option (must be reason 0 then:) ). Thanks for pointing this out! – andselisk Dec 10 '17 at 20:22--
has been used historically as a separator, as in the GNU Arch version control system written by Tom Lord; personally, I've found the convention to be useful, and leveraged it myself, since. On the other hand, this was (like several of Arch's other naming conventions) considered pretty weird by a lot of people at the time. – Charles Duffy Dec 10 '17 at 21:272017-12-11T19-45 JDoe-042 UO2(NO3)2-EtOAc_dist 150.3K 1.234mM.dat
nice. Otherwise=
,~
,+
seem good too. – user285259 Dec 11 '17 at 23:15%20
to make the name web-safe, and yes, I encountered the software that couldn't tolerate spaces, though it was a long time ago. Regarding=
,~
,+
I feel somewhat uncomfortable as semantically they represent math operators, and I haven't seen many people using them as the filename delimiters (maybe there is an another reason for that). – andselisk Dec 12 '17 at 00:53(
translated to%28
, and)
to%29
? =) Actually, I don't really understand the problem of escaping name, this is just translated for software, but this is not the form displayed to the user. – user285259 Dec 12 '17 at 05:01