Forum Moderators: phranque

Message Too Old, No Replies

folder full of .html files

         

hermes

3:00 am on Jun 27, 2006 (gmt 0)

10+ Year Member



I have a folder full of .html files (thousands). I would like to get a list of these in plain text format. eg.

index.html
cranberries.html
woodbridge.html

How can I go about getting such a list aside from doing it manually? There must be a way to do this automatically. There just must be.......I prey.

deejay

3:09 am on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do a search for a lovely little bit of freeware 'ls - file list generator'.

Will output the list of file names into a text file

eelixduppy

3:23 am on Jun 27, 2006 (gmt 0)



On windows you can do something like this is the command prompt:
dir > files.txt

hermes

8:03 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



thanks so, so much.

Perhaps you guys can help with a second problem I have. Do you know of any tool that can:

1) Take 4 lines of code. Then repeat this code down the page for a given number of times (300).

2) I have a list of 300 filenames. I want to iterate through placing a filename into each of the 300 4 line code blocks. A different filename for each 4 line code block.

deejay

8:26 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hmmmm... not specifically, no.

I'd probably just end up throwing that into Excel, myself.

FalseDawn

11:12 pm on Jun 27, 2006 (gmt 0)

10+ Year Member




Perhaps you guys can help with a second problem I have. Do you know of any tool that can:

1) Take 4 lines of code. Then repeat this code down the page for a given number of times (300).

2) I have a list of 300 filenames. I want to iterate through placing a filename into each of the 300 4 line code blocks. A different filename for each 4 line code block.

Wow, that's an awful solution. Just code a loop instead, and on each iteration, read the filenames from either a text file, or dump them first to a database table and read from that.

physics

10:57 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This can be done easily using Perl (or PHP) code by making the 4 lines a template .txt file (or string) with the place where the file name should go something like __FILENAME__ then read that in and do a regex replace like: s/__FILENAME__/$filename/ where $filename is a variable that contains the file name, read in from your list. There may be better ways to accomplish what you want though... why do you want a file with code blocks repeated so many times? A loop with a function call would be better usually...

hermes

6:19 pm on Jun 28, 2006 (gmt 0)

10+ Year Member



thanx guys. have this done now. a friend did it in excel - hes a bit of an excel wiz. not really sure how he did it. but it done. so im happy.