How to copy/move multiple files from a single directory into different subfolders
NB: filenames should not contain blank spaces or special characters (e.g. &, %, !, (, etc)
Step 1 : Extract simple list of filenames
Navigate to source directory and run ls command
\
Figure 1 : list command output to screen and saved to text file
NOTE: In this example, all converted files have been saved to a single folder (e.g. path/output). Converted files may be access versions (*.mp4) or master versions (*.mov)
Step 2 : Get path to destination directory
Change directory (type “cd”) and drag top folder to terminal screen and press enter
Enter “pwd” command to get full path of destination directory
Figure 2 : Destination Directory Path
Step 3 : Create commands
In excel: Create table with following columns
column
|
value
|
description
|
1st
|
cp
|
copy command (to move files instead of copy, replace cp with mv)
|
2nd
|
filenames
|
Data from step 1 (drag filenames.txt to MS Excel icon to open)
|
3rd
|
Destination path/sub folder
|
Path to destination directory (from Step 2) plus name of object folder. The object folder is the digital id value.
TIP: create data using excel formulas =CONCATENATE($B$1,"/",LEFT(B18,8))
|
4th
|
|
|
Pipe symbol (for all rows except last)
|
Figure 3 : Excel screen shot
Step 4 : Clean up spacing
In MS word
Figure 4 : Using search, find all tabs (shown in yellow highlights)
Step 5 : Run commands
In terminal
TIP: as proof of concept recommend first test single command and confirm file has been copied as expected
Step 6 : Verify
Spot check using finder
Comments (0)
You don't have permission to comment on this page.