• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

Batch create subfolders (terminal)

Page history last edited by Monica 7 years, 5 months ago Saved with comment


 

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.