Step 1 : Create list of folder names
TIP: extract folder names from filenames:
-
Navigate to source directory and run ls command and output to *.txt file
-
Open txt file in Excel
-
Pull object ids from filenames. Tip: use =LEFT() function (in this case the prefix of filename is the object id (eg. wrc02788_003.mp4 → wrc02788)
-
Run pivot table to summarize object names (in cases when more than one file per object)
Step 2 : Clean up spacing
Open MS word
Copy folder names to MS word (use paste special > unformatted text)
Remove any hard returns (search and replace paragraph marks ^p with single space)
Edit/Select All
Figure : Before and After replacing paragraph marks with single blank space
Step 3 : Run commands
In terminal
1) go to source directory where you wish new folders to be added (cd + drag folder )
2) type mkdir command (only once)
3) paste folder names copied from MS Word (Step 2)
4) Press enter
TIP: as proof of concept recommend first test single command and confirm file has been copied as expected.
Step 4 : Verify
run list (ls) command to show folder names
Multiple subdirectories
By using -p option can make subdirectories within parent directories
Figure : new subfolder highlighted in blue
Figure: copy/paste from MSword (replaced ^t only - ea command appears on a new line)
Comments (0)
You don't have permission to comment on this page.