> For the complete documentation index, see [llms.txt](https://gitbook.bergelsonlab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.bergelsonlab.com/archive/old-osf-pages/scripts-and-the-like/directory-reader.md).

# Directory Reader

This script is used to create folders (as opposed to just manually making them...)

### Creating directories

This is to create folders for each month (e.g. 01\_06, 01\_07, etc.)

1. Launch script
2. Select "Yes" when you are asked whether you want to "Create all Files?"
3. Browse to the subject's **MAIN** folder; this is labeled with their birthday (ex. *01\_02-03-2014*)
4. Confirm the subject's ID in the next dialog box (01 in the example above)
5. Confirm that all sub-folders were generated in the subject's directory

### Sorting into directories

1. Launch script
2. Select "No" when you are asked whether you want to "Create all Files?"
3. Select whether you are sorting files for a month that includes a lab visit (i.e. even months)
4. In the first pop-up window; navigate to the folder (within ''Subject\_Files'') where you want to move the files of interest (e.g. *Subject\_Files/01\_02-03-2014/01\_06*)
   * This step also creates the directory if does not already exist
5. In the second pop-up window; select the proper folder (within ''Working Files'') that contains the files you want to move (e.g. *Working\_Files/01\_06*).
6. The resulting window first lists all files that were named incorrectly, according to the [File Naming](https://docs.google.com/spreadsheets/d/1zcEHtiX1ev_wIeCLrgw2ek-H7QfonmW-1OGfpkGS1qI/edit?usp=sharing) doc
7. Sometimes a file may be considered incorrectly named by the script when it is actually not (e.g. some may be due to a corrupted video process, backup copies of coding files, etc.)\
   ![](https://mfr.osf.io/export?url=https://osf.io/s468c/?action=download\&direct\&mode=render\&initialWidth=642\&childId=mfrIframe\&format=1200x1200.jpeg)
8. The window also lists the files that were not replaced because they already exist in the final destination folder
9. This may happen if the *Working\_Files* folder contained a copy of an audio file, notes word document, or coding file that was already within the *Subject\_Files*destination
10. In these cases, you must manually check to see which is the correct file and then move it into the final directory for that subject \
    ![enter image description here](https://mfr.osf.io/export?url=https://osf.io/3hfsz/?action=download\&direct\&mode=render\&initialWidth=598\&childId=mfrIframe\&format=1200x1200.jpeg)

### Some housekeeping

1. Make sure to mark that you have completed the *(Final)File Organization* and *Due* tasks as complete on ASANA
2. Archive (do NOT delete) the project
3. Delete the empty folders from *Working\_Files*
