Re: script help list all files in folders and subfolders
[email protected] ("Dr. Saiful Amin") Tue, 31 Mar 2015 17:43:38 +0530
| Newsgroups | perl.perl4lib |
|---|---|
| Message-ID | <CALetcjNWN8MAvbxzf-jLcKpE1qjg_OCYHocTrCqVOBOOZZa2WA@mail.gmail.com> |
--047d7b6765e287bd3205129488f5 Content-Type: multipart/alternative; boundary=047d7b6765e287bd2e05129488f3 --047d7b6765e287bd2e05129488f3 Content-Type: text/plain; charset=UTF-8 Hi, Wrote this almost a decade back for a similar need. I've removed some irrelevant lines, but didn't test it. Obviously a quick-n-dirty script, but I hope it works for you:) Best regards, Saiful Amin +91-9343826438 Skype: saiful.amin On Tue, Mar 31, 2015 at 1:29 PM, George Milten <[email protected]> wrote: > Hello friendly folks, > > i would appreciate any help on the following: > > say we have a folder with thousands of html files. Since the file browser > crashes, i am looking at making a script that would do the following: > Distribute all html files in folders, say 001, 002, 003, etc, sorted by the > html files' names. Then, i would like to create an index also an html file, > that would exist in each folder, containing links to all the folder's > stored html files. Also, if possible, a general index in the parent folder, > that would allow for a tree like showing the directories as links, and in a > tree like representation, below the links of the files contained in each > folder. > > Thank you in advance > > p.s. we use Perl 5.18,in an ubuntu 14.04 server > --047d7b6765e287bd2e05129488f3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:trebuche= t ms,sans-serif">Hi,<br><br></div><div class=3D"gmail_default" style=3D"fon= t-family:trebuchet ms,sans-serif">Wrote this almost a decade back for a sim= ilar need. I've removed some irrelevant lines, but didn't test it. = Obviously a quick-n-dirty script, but I hope it works for you:)<br></div></= div><div class=3D"gmail_extra"><br clear=3D"all"><div><div class=3D"gmail_s= ignature"><div dir=3D"ltr">Best regards,<br>Saiful Amin<br>+91-9343826438<b= r>Skype: saiful.amin<br></div></div></div> <br><div class=3D"gmail_quote">On Tue, Mar 31, 2015 at 1:29 PM, George Milt= en <span dir=3D"ltr"><<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>></span> wrote:<br><blockquote cl= ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p= adding-left:1ex"><div dir=3D"ltr">Hello friendly folks,<div><br></div><div>= i would appreciate any help on the following:</div><div><br></div><div>say = we have a folder with thousands of html files. Since the file browser crash= es, i am looking at making a script that would do the following: Distribute= all html files in folders, say 001, 002, 003, etc, sorted by the html file= s' names. Then, i would like to create an index also an html file, that= would exist in each folder, containing links to all the folder's store= d html files. Also, if possible, a general index in the parent folder, that= would allow for a tree like showing the directories as links, and in a tre= e like representation, below the links of the files contained in each folde= r.</div><div><br></div><div>Thank you in advance</div><div><br></div><div>p= .s. we use Perl 5.18,in an ubuntu 14.04 server</div></div> </blockquote></div><br></div> --047d7b6765e287bd2e05129488f3-- --047d7b6765e287bd3205129488f5 Content-Type: application/octet-stream; name="th.pl" Content-Disposition: attachment; filename="th.pl" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i7x9hk2j0 IyEvdXNyL2Jpbi9wZXJsDQojIHRoLnBsDQoNCm9wZW5kaXIoUk9PVCwgIjEwMCIpOw0KDQpvcGVu KE9VVCwgIj4xMDAvaW5kZXguaHRtbCIpOw0KcHJpbnQgT1VUICI8aHRtbD48aGVhZD48dGl0bGU+ SW5kZXg8L3RpdGxlPjwvaGVhZD48Ym9keT48dGFibGUgYm9yZGVyPVwiMVwiPlxuIjsNCg0KJHNm b2xkZXIgPSAnJzsNCmZvcmVhY2ggJGZvbGRlciAocmVhZGRpcihST09UKSkgew0KICAgIG5leHQg aWYgJGZvbGRlcj1+L15cLi87DQoNCiAgICAkc2ZvbGRlciA9ICIxMDAvJGZvbGRlciI7DQogICAg b3BlbmRpcihESVIsICRzZm9sZGVyKTsNCiAgICBwcmludCBPVVQgIjx0cj48dGQ+PGI+JGZvbGRl cjwvYj48L3RkPjwvdHI+IjsNCiAgICBmb3JlYWNoICRmaWxlIChyZWFkZGlyKERJUikpIHsNCiAg ICAgICAgbmV4dCBpZiAkZmlsZSA9fi9eXC4vOw0KICAgICAgICBuZXh0IGlmICRmaWxlID1+L2pw Zy87DQogICAgICAgIG5leHQgaWYgJGZpbGUgPX4vXlRodW1iLzsNCiAgICAgICAgJGZuYW1lID0g JGZpbGU7DQogICAgICAgICRmbmFtZSA9fnMvXC4uKi8vOw0KICAgICAgICAjcHJpbnQgJGZuYW1l LCAiXG4iOw0KICAgICAgICANCiAgICAgICAgb3BlbihTRklMRSwgIiRzZm9sZGVyLyRmaWxlIik7 DQogICAgICAgIEBkb2MgPSA8U0ZJTEU+Ow0KICAgICAgICAkdG1wVGl0bGUgPSAkZG9jWzBdOw0K ICAgICAgICAjcHJpbnQgJHRtcFRpdGxlLCAiXG4iOw0KICAgICAgICANCiAgICAgICAgcHJpbnQg T1VUICI8dHI+PHRkPjxhIGhyZWY9XCIkZm9sZGVyLyRmaWxlXCI+JHRtcFRpdGxlPC9hPjxicj48 L3RkPjwvdHI+XG4iOw0KICAgICAgICB3YXJuICIuIjsNCiAgICAgICAgY2xvc2UoU0ZJTEUpOw0K ICAgIH0NCiAgICBjbG9zZShESVIpOw0KICAgIHByaW50ICJcbiI7DQp9DQpwcmludCBPVVQgIjwv dGFibGU+PC9ib2R5PjwvaHRtbD4iOw0KY2xvc2UoT1VUKTs= --047d7b6765e287bd3205129488f5--