Best Practices for Naming Files

File names should allow you to identify a precise experiment from the name. Choose a format for naming your files and use it consistently.

You might consider including some of the following information in your file names, but you can include any information that will allow you to distinguish your files from one another.

  • Project or experiment name or acronym
  • Location/spatial coordinates
  • Researcher name/initials
  • Date or date range of experiment
  • Type of data
  • Conditions
  • Version number of file
  • Three-letter file extension for application-specific files

Another good idea is to include in the directory a readme.txt file that explains your naming format along with any abbreviations or codes you have used.

Other tips for file naming

  • A good format for date designations is YYYYMMDD or YYMMDD. This format makes sure all of your files stay in chronological order, even over the span of many years.
  • Try not to make file names too long, since long file names do not work well with all types of software.
  • Special characters such as ~ ! @ # $ % ^ & * ( ) ` ; < > ? , [ ] { } ' " and | should be avoided.
  • When using a sequential numbering system, using leading zeros for clarity and to make sure files sort in sequential order. For example, use "001, 002, ...010, 011 ... 100, 101, etc." instead of "1, 2, ...10, 11 ... 100, 101, etc."
  • Do not use spaces. Some software will not recognize file names with spaces, and file names with spaces must be enclosed in quotes when using the command line. Other options include:
    • Underscores, e.g. file_name.xxx
    • Dashes, e.g. file-name.xxx
    • No separation, e.g. filename.xxx
    • Camel case, where the first letter of each section of text is capitalized, e.g. FileName.xxx



SOURCE: https://library.stanford.edu/research/data-management-services/data-best-practices/best-practices-file-naming