Using consistent, straightforward, and well thought out file names will help you and others make sense of your files.
Files names are the fastest way to identify what is inside a file and how it differs from similar files. You should name your files based on important elements of your project such as:
You can combine elements as needed to create a file naming convention that you can use during the entire project. An explanation of what each element of the file name means should be documented. One easy way to do this is to create a readme text file in the project's top folder.
Example: README section explaining file names
Plot ID (i.e. Plot01, Plot02, etc.) refers to where the samples were obtained. The file plotmap.png shows where each plot is located. The date the samples were collected is in the file name and formatted as YYYY-MM-DD.
The initials of the person who collected the samples that day is at the end of the file.
GH = Gavin Hill; AT = Aisha Taylor
Consider how you want to track the files (i.e. chronologically, by location, by sample, etc.). The most important elements should be at the start of your file names so that you can sort by these elements.
The example below shows how files sort differently depending on which name element is used first. If you needed to track the project by dates then the "By date" method would work better than the "By plot" method.
By date | By plot |
---|---|
2018-04-10_Plot01_GH.csv | Plot01_2018-04-10_GH.csv |
2018-04-10_Plot02_AT.csv | Plot01_2018-06-03_GH.csv |
2018-06-03_Plot01_GH.csv | Plot02_2018-04-10_AT.csv |
2018-06-04_Plot02_GH.csv |
Plot02_2018-06-04_GH.csv |
Don't reinvent the wheel. Use existing standards whenever possible! This will make it easier for others to understand the file names.
For example, there is a standard that defines how dates and times should be recorded: ISO 8601. Using this standard eliminates common points of confusion such as the difference between US and European dates which swap the order of day and month.
Just because you can use something doesn't mean you should. There are two big reasons to avoid special characters, punctuation marks, and symbols in filenames:
And never use emojis (😱). There are multiple problems with using them in file names so the best recommendation is don't.
Periods (.) should only be used to separate the file name from the file extension. Do not use periods to separate different elements of a file name, use a dash (-) or an underscore (_) instead.
The same rule applies for multiple periods (i.e. .. and ...). Don't do it!
The last practice we'll cover is avoiding spaces in file names. Spaces are not supported by all operating systems or by command line applications. A space in a filename can cause errors when loading a file or when transferring files between computers. Common replacements for spaces in a filenames are dashes (-) or underscores (_). And as some operating systems treat these characters as spaces in file searches, there is little technical benefit in using spaces in file names.
Alternatively you can also use a technique called camelCase which uses letter case to separate name elements. However, camelCase is hard to search for because operating systems will not separate words based on letter case.
Examples on this page were kindly provided by Iowa State University, reused with permission.