FAQ
Hi All,

I am new to any programming language .I am trying to copy one file structure.

I have a folder structures which contains setup files, cleanup files and test file

like
/testplan
/testplan/setup
/testplan/cleanup
/testplan/2.1/setup
/testplan/2.1/cleanup
/testplan/2.1/2.1.1/setup
/testplan/2.1/2.1.1/cleanup
/testplan/2.1/2.1.1/2.1.1.1
/testplan/2.1/2.1.1/2.1.1.1/test
/testplan/2.1/2.1.1/2.1.1.2
/testplan/2.1/2.1.1/2.1.1.2/test
/testplan/2.1/2.1.2/2.1.2.2/setup
/testplan/2.1/2.1.2/2.1.2.2/test
/testplan/2.1/2.1.2/2.1.2.2/cleanup
/testplan/2.1/2.1.2/2.1.2.3/test
/testplan/2.2/2.2.1/2.2.1.2
/testplan/2.2/2.2.1/2.2.1.2/test

I have a file where I have mentioned the test name like
/testplan/2.1/2.1.1/2.1.1.1
testplan/2.2/2.2.1/2.2.1.2

Now I want to create another file structure where it will copy the directory tree which I have mentioned in the file
Suppose in my file name I have mentioned

/testplan/2.1/2.1.1/2.1.1.1
/testplan/2.2/2.2.1/2.2.1.2/

Then the script will create a folder
folder/setup
folder/cleanup
/folder/2.1/setup
/folder/2.1/cleanup
/folder/2.1/2.1.1/setup
/folder/2.1/2.1.1/cleanup
/folder/2.1/2.1.1/2.1.1.1
/folder/2.1/2.1.1/2.1.1.1/test
/folder/2.2/2.2.1/2.2.1.2/test

Please Note: setup, cleanup and test are files that i want to copy and create another similar file structure .In the above example


Regards
Sree












Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

Search Discussions

  • Rock Lifestyle at Feb 22, 2009 at 12:27 pm
    --- On Sat, 21/2/09, Rock Lifestyle wrote:

    From: Rock Lifestyle <lifestyle.rock@yahoo.in>
    Subject: Help regarding file find
    To: beginners@perl.org
    Date: Saturday, 21 February, 2009, 6:30 PM

    Hi All,

    I am new to any programming language .I am trying to copy one
    file structure.

    I have a folder structures which contains setup files, cleanup files and
    test file

    like
    /testplan
    /testplan/setup
    /testplan/cleanup
    /testplan/2.1/setup
    /testplan/2.1/cleanup
    /testplan/2.1/2.1.1/setup
    /testplan/2.1/2.1.1/cleanup
    /testplan/2.1/2.1.1/2.1.1.1
    /testplan/2.1/2.1.1/2.1.1.1/test
    /testplan/2.1/2.1.1/2.1.1.2
    /testplan/2.1/2.1.1/2.1.1.2/test
    /testplan/2.1/2.1.2/2.1.2.2/setup
    /testplan/2.1/2.1.2/2.1.2.2/test
    /testplan/2.1/2.1.2/2.1.2.2/cleanup
    /testplan/2.1/2.1.2/2.1.2.3/test
    /testplan/2.2/2.2.1/2.2.1.2
    /testplan/2.2/2.2.1/2.2.1.2/test

    I have a file where I have mentioned the test name like
    /testplan/2.1/2.1.1/2.1.1.1
    testplan/2.2/2.2.1/2.2.1.2

    Now I want to create another file structure where it will copy the directory
    tree which I have mentioned in the file
    Suppose in my file name I have mentioned

    /testplan/2.1/2.1.1/2.1.1.1
    /testplan/2.2/2.2.1/2.2.1.2/

    Then the script will create a folder
    folder/setup
    folder/cleanup
    /folder/2.1/setup
    /folder/2.1/cleanup
    /folder/2.1/2.1.1/setup
    /folder/2.1/2.1.1/cleanup
    /folder/2.1/2.1.1/2.1.1.1
    /folder/2.1/2.1.1/2.1.1.1/test
    /folder/2.2/2.2.1/2.2.1.2/test

    Please Note: setup, cleanup and test are files that i want to copy and create
    another similar file structure .In the above example


    Regards
    Sree












    Add more friends to your messenger and enjoy! Go to
    http://messenger.yahoo.com/invite/


    Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/
  • Gunnar Hjalmarsson at Feb 23, 2009 at 1:22 am

    Rock Lifestyle wrote:
    I am new to any programming language .I am trying to copy one file
    structure.

    I have a folder structures which contains setup files, cleanup files
    and test file <snip>
    Now I want to create another file structure where it will copy the
    directory tree which I have mentioned in the file
    Suppose in my file name I have mentioned

    /testplan/2.1/2.1.1/2.1.1.1
    /testplan/2.2/2.2.1/2.2.1.2/

    Then the script will create a folder
    folder/setup
    folder/cleanup
    /folder/2.1/setup
    /folder/2.1/cleanup
    /folder/2.1/2.1.1/setup
    /folder/2.1/2.1.1/cleanup
    /folder/2.1/2.1.1/2.1.1.1
    /folder/2.1/2.1.1/2.1.1.1/test
    /folder/2.2/2.2.1/2.2.1.2/test
    Do it manually, learn a programming language and have your computer do
    it, or hire a consultant.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
  • Dermot at Feb 23, 2009 at 10:51 am

    2009/2/21 Rock Lifestyle <lifestyle.rock@yahoo.in>:
    Hi All,

    I am new to any programming language .I am trying to copy one file structure.

    I have a folder structures which contains setup files, cleanup files and test file

    like
    /testplan
    /testplan/setup
    /testplan/cleanup
    /testplan/2.1/setup
    /testplan/2.1/cleanup
    /testplan/2.1/2.1.1/setup
    /testplan/2.1/2.1.1/cleanup
    /testplan/2.1/2.1.1/2.1.1.1
    /testplan/2.1/2.1.1/2.1.1.1/test
    /testplan/2.1/2.1.1/2.1.1.2
    /testplan/2.1/2.1.1/2.1.1.2/test
    /testplan/2.1/2.1.2/2.1.2.2/setup
    /testplan/2.1/2.1.2/2.1.2.2/test
    /testplan/2.1/2.1.2/2.1.2.2/cleanup
    /testplan/2.1/2.1.2/2.1.2.3/test
    /testplan/2.2/2.2.1/2.2.1.2
    /testplan/2.2/2.2.1/2.2.1.2/test

    I have a file where I have mentioned the test name like
    /testplan/2.1/2.1.1/2.1.1.1
    testplan/2.2/2.2.1/2.2.1.2

    Now I want to create another file structure where it will copy the directory tree which I have mentioned in the file
    Suppose in my file name I have mentioned

    /testplan/2.1/2.1.1/2.1.1.1
    /testplan/2.2/2.2.1/2.2.1.2/

    Then the script will create a folder
    folder/setup
    folder/cleanup
    /folder/2.1/setup
    /folder/2.1/cleanup
    /folder/2.1/2.1.1/setup
    /folder/2.1/2.1.1/cleanup
    /folder/2.1/2.1.1/2.1.1.1
    /folder/2.1/2.1.1/2.1.1.1/test
    /folder/2.2/2.2.1/2.2.1.2/test
    Most of the heavy lifting with your requirements can be done with
    File::Find and File::Path.
    Good luck,
    Dp.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbeginners @
categoriesperl
postedFeb 21, '09 at 6:31p
activeFeb 23, '09 at 10:51a
posts4
users3
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase