[Israel.pm] Directory Browsing

Itamar Elem elem at compugen.co.il
Mon Aug 2 23:48:01 PDT 2004


you can use File::Find  to do the recursive process for you
   use File::Find;
    find(\&wanted, @directories_to_search);
    sub wanted { ... }

or if  all of your subfolders in the same level mabye you can use
the glob operatot  

itamar

-----Original Message-----
From: Georges EL OJAIMI [mailto:g-ojaimi at cyberia.net.lb]
Sent: Sunday, August 01, 2004 12:58 PM
To: perl at perl.org.il
Subject: [Israel.pm] Directory Browsing


Hello,

I have a big folder with non ending subfolders and fragmented files.
I want first to browse to the end to these subfolders and append the content of the files into one file per parent directory.

# Original Structure
/rootDirectory
    /Folder1
        /subFolder1
            File1.1.txt
            File1.1.2.txt
        /subFolder2
            File1.2.txt
            File1.2.2.txt
            File1.2.3.txt
    /Folder2
        /subFolder1
            File2.1.txt
            File2.1.2.txt
            File2.1.3.txt
        /subFolder2
            File2.2.txt
            File2.2.2.txt
etc...

# Desired Output
/rootDirectory
    /Folder1
        myFile1.txt (containing File1.1.txt until File1.n.txt)
    /Folder2
        myFile2.txt (containing File2.1.txt until File2.n.txt)

Is there any way and fast way (no memory processing) to do it while the size of the rootDirectory might reach the 1 GB and the process is repeated each day?

Best Regards,
Georges

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list