Been trying for hours to get this to work - but I'm a complete novice (e.g. started using terminal today) and struggling to get this working.
I have a csv file that lists filenames row by row. I want to find them and copy them to a new directory. The files are listed in one directory, but each file is in its own subdirectory.
This is what I have tried, but it is not copying anything. But I can see it cycling through the searches:
cat /Users/Will/Downloads/three-new.csv | while IFS=, read col1
do
find /Volumes/LaCie\ 8tb/BPOTY/2021\ Photos -path $col1 -exec cp {} /Volumes/LaCie\ 8tb/BPOTY/2021\ book \;
done
I have also tried this, but it just copies all files from the directory (stripping the subdirectories) and doesn't find the actual filenames.
cat /Users/Will/Downloads/three-new.csv | while IFS=, read col1
do
find /Volumes/LaCie\ 8tb/BPOTY/2021\ Photos $col1 -exec cp {} /Volumes/LaCie\ 8tb/BPOTY/2021\ book \;
done
The file can be seen here: https://www.dropbox.com/s/6uqwzky43r25ors/three.csv?dl=0
Have run a command as requested and the CSV outputs:
00000000: 636f 6c31 0d0a 494d 475f 3437 3538 2d64 col1..IMG_4758-d
00000010: 6e2e 6a70 670d 0a43 4f45 5f32 3330 352d n.jpg..COE_2305-
00000020: 4564 6974 2e74 6966 2e7a 6970 0d0a 5f44 Edit.tif.zip.._D
00000030: 5343 3435 3933 2d68 6972 6573 2d72 6573 SC4593-hires-res
00000040: 6f6c 7574 696f 6e2d 5065 7465 722d 6365 olution-Peter-ce
00000050: 6368 2d54 6865 2d6c 6f6f 6b2e 6a70 67 ch-The-look.jpg