Front page | perl.beginners |
Postings from December 2002
Newbie question
Thread Next
From:
Ashutosh Jog
Date:
December 11, 2002 09:44
Subject:
Newbie question
Message ID:
3DF6B6D0.8020901@pdf.com
Hello all,
I am a complete newbie and am trying to do a couple of things but was
not able to. Any assitance is welcome.
If I have a dir structure G:\abc\efg\qrs.txt:
1) How can I list the entire structure under G:\abc along with all the dirs. under G:\abc\ right upto the file qrs.txt ?
In this structure the dir name abc will not change and neither will the name of the file qrs.txt. But there will be a different dir name for efg for eg: there will be dirs as under
G:\abc\efg\qrs.txt
G:\abc\hij\qrs.txt .......etc. etc.
How can I have these listed in a file (line by line) using perl?
2) Then I would want to take the individual dir names under G:\abc and
put them in a separate txt file.
For eg: From the above eg., I would like to have the dir's 'efg' and
'hij' listed in a diff txt file, line by line (i.e just these dir name)
Is there a way to do so in perl? I could do the first part in shell
script but wasn't sure how it would work under perl. Thank you in
advance for your patience.
Cheers,
Thread Next
-
Newbie question
by Ashutosh Jog