To move files to another folder would not require the use of the Automator or Apple Script. You could accomplish this by entering commands in a Terminal application window.
Example 1
Below is the contents of a file nameed list.csv
. This file just contains the names of files to be moved to another folder.
file001,file002,file003
file004,file005
file006
From bash
, the command below would move the files to a folder named MyTarget
.
(IFS=,; while read -u 5 -a w; do for j in ${w[@]}; do mv -i "$j" MyTarget; done; done)5<list.csv
From zsh
, the command would change to the following.
(IFS=,; while read -u 5 -A w; do for j in ${w[@]}; do mv -i "$j" MyTarget; done; done)5<list.csv
Note: You can do a dry-run by preceding the mv
with echo
. For zsh
, the command would appear as shown below.
(IFS=,; while read -u 5 -A w; do for j in ${w[@]}; do echo mv -i "$j" MyTarget; done; done)5<list.csv
This command would produce the following output.
mv -i file001 MyTarget
mv -i file002 MyTarget
mv -i file003 MyTarget
mv -i file004 MyTarget
mv -i file005 MyTarget
mv -i file006 MyTarget
Example 2
Below is the contents of a file nameed list.csv
. Here, the name of a file to move is the second item on each line.
black,file001,yes,5
brown,file002,no,6
red,file003,no,7
orange,file004,yes,30
yellow,file005,no,3
green,file006,no,99
From bash
, the command below would move the files to a folder named MyTarget
.
(IFS=,; while read -u 5 -a w; do mv -i "${w[1]}" MyTarget; done)5<list.csv
From zsh
, the command would change to the following.
(IFS=,; while read -u 5 -A w; do mv -i "${w[2]}" MyTarget; done)5<list.csv