Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Find the array containing string and copy the file to other folder exactly

by SubaRavi (Initiate)
on Apr 05, 2019 at 06:19 UTC ( [id://1232173]=CUFP: print w/replies, xml ) Need Help??

Find the array containing string and copy the file to other folder extactly

use strict; use warnings; use File::Copy; use File::Find::Rule; use File::Find; use File::Basename; my $source_dir = "<Sorce Directory with specific files>"; my @doc=File::Find::Rule->file->name('*.xml')->in($source_dir); my $path="<parent folder>"; my @folders; find sub{ push @folders, "$File::Find::name" if (-d $File::Find::name); },$path; foreach my $fileformat (@doc){ my $baseFile=basename ($fileformat); $baseFile=~s/\.xml//isg;###handled xml for sake my @results = grep /$baseFile/, @folders; copy ($fileformat,@results); ###copied files to destination and ma +tched }

Replies are listed 'Best First'.
Re: Find the array containing string and copy the file to other folder extactly
by davido (Cardinal) on Apr 05, 2019 at 06:47 UTC

    Please let us know what your question is so that we can try to lend assistance. Stating the design requirement isn't a question. Ask about the part you are having trouble with.


    Dave

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://1232173]
Approved by NetWallah
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2024-03-28 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found