Skip to content

Hints and tips

Alex Henderson edited this page Feb 7, 2024 · 1 revision

Home > Hints and tips

Hints and tips

Grabbing all filenames in a folder

(Microsoft Windows)

This can be useful in many circumstances, especially to populate the Filename column in a ChiMetadataSheet Excel File.

  1. Using Windows Explorer, navigate to the folder containing the files
  2. Hold down the shift key and right-click on an empty region in the folder (ie. not on a file or subfolder)
  3. From the pop-up menu select Open command window here
  4. In the Command Window that appears, type one of the following:
    1. To save the filenames to a file (here named 'filenames.txt') enter dir /b > filenames.txt
    2. To go directly to the clipboard enter: dir /b | clip
  5. To get some of the filenames (say Grams SPC files) enter: dir /b *.spc > filenames.txt or dir /b *.spc | clip
  6. Replace *.spc with the file extension required. For multiple file extensions, separate them with a semicolon eg. *.txt;*.csv
  7. For more complicated selection options use wildcards, where a question mark stands for any single character and an asterisk (*) stands for multiple consecutive characters.

If using the 'save to file' version, a file called filenames.txt will now appear in the folder. This contains the filenames chosen and can be edited using Notepad (or a better text editor such as Notepad++). Any filename will suffice, so feel free to be creative. Note that the file is created before the dir command executes, so it will appear in the file listing if it fits the naming convention requested (eg. all files, or *.txt files)

Grabbing a folder name

(Microsoft Windows)

This can be useful in many circumstances, especially to complete the Path to data files: field in a ChiMetadataSheet Excel File.

  1. Using Windows Explorer, navigate to the folder containing the files
  2. Click in the folder location bar at the top of the Explorer window, ensuring not to click on any of the folder names
  3. Copy and paste as required
Clone this wiki locally