'copy files from folder based on csv file list
I want to copy certain files from a folder based on a list stored in a .csv file. Previously I used rsync to do this using
rsync -a /source/directory --files-from=/full/path/to/listfile /destination/directory
However, the files in the folder contain additional characters not found in the .csv list - for example:
1_file_name1.extension
12_file_name2.extension
123_file_name3.extension
as compared with the ones in the .csv file:
file_name1.extension
file_name2.extension
file_name3.extension
Is there a way that I can convince rsync/cp/anything else to copy these files strictly based on file_name.extension
or file_name
?
Many thanks!
LE: based on Bodo's suggestions I want to mention that the files are located in the main directory (no subfoders) and it would be perfectly ok if I could copy all files that match the pattern *file_name1.extension.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|