ramjamman has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks I would welcome any suggestions as to the best way to resolve this problem
I have on a centos server about 7000 files mostly pdf in one directory. I need to download about 4000 of them for which I have a list in a csv or txt file of their names.
I am thinking the best way to approach this is to run a script from the command line to copy the files required into a new directory using a script something like that below and then I can download them .
However I am always open to any suggestions of any other methods that would achieve a solution to this problem Thank You
#!/usr/bin/perl -w open FILE , '<' , "mylist.txt" || die "$!"; while (<FILE>){ chomp; system("cp $_ newdirectory/"); } close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Copying a list of files from a directory to a new directory (updated)
by AnomalousMonk (Archbishop) on Jul 21, 2018 at 02:10 UTC | |
|
Re: Copying a list of files from a directory to a new directory
by roboticus (Chancellor) on Jul 21, 2018 at 04:59 UTC | |
by Laurent_R (Canon) on Jul 21, 2018 at 10:50 UTC | |
by soonix (Chancellor) on Jul 21, 2018 at 17:15 UTC | |
by roboticus (Chancellor) on Jul 21, 2018 at 20:27 UTC | |
by ramjamman (Sexton) on Jul 21, 2018 at 09:52 UTC | |
|
Re: Copying a list of files from a directory to a new directory
by Laurent_R (Canon) on Jul 21, 2018 at 08:46 UTC |