Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Albone

macrumors regular
Original poster
Jul 22, 2003
120
0
I have to make a web page (single page with multiple rows) that has links to over a hundred word documents.

Is there an automated way in Dreamweaver or otherwise, that I can take a folder with 100 word documents, and create a web page with links to each word doc? It doesn't have to be pretty, but there's gotta be a better way than me creating 100 links manually.

Thanks
 
Albone said:
I have to make a web page (single page with multiple rows) that has links to over a hundred word documents.

Is there an automated way in Dreamweaver or otherwise, that I can take a folder with 100 word documents, and create a web page with links to each word doc? It doesn't have to be pretty, but there's gotta be a better way than me creating 100 links manually.

Thanks


hmm it's gotta be possible with an array of some kind wheather it be javascript or php. I'm not sure how simple that solution is as I don't really have time to think about it but it sounds like an array is the answer.
 
Does your web host support PHP?
Right from their site with some customization. http://us2.php.net/readdir
PHP:
<?php
$folder = "myWordDocs"; //relative to this page

if ($handle = opendir($folder)) {
   while (false !== ($file = readdir($handle))) {
       if ($file != "." && $file != "..") {
           echo "<a href='$folder/$file'>$file</a><br>\n";
       }
   }
   closedir($handle);
}
?>
 
kingjr3 said:
Does your web host support PHP?
Right from their site with some customization. http://us2.php.net/readdir
PHP:
<?php
$folder = "myWordDocs"; //relative to this page

if ($handle = opendir($folder)) {
   while (false !== ($file = readdir($handle))) {
       if ($file != "." && $file != "..") {
           echo "<a href='$folder/$file'>$file</a><br>\n";
       }
   }
   closedir($handle);
}
?>

You could also just point to the directory containing the word files. A list of all files in the directory would be displayed, with file names working as links...

(I'm assuming your webserver is Apache, and the Indexes option is enabled)
 
If you have Excel, you could write a formula (and fill it down through a column of cells) that would create the links for as many files as you have. You'd first need to import a list of the files into a worksheet... for example:

A1: foo.doc
A2: bar.doc
A3: baz.doc

Once you had this, the formula to enter into cell B1 might look something like this:

B1: ="<a href=""http://www.yourdomain.com/docs/"&A1&""">"

The result of this formula would be:

<a href="http://www.yourdomain.com/docs/foo.doc">

Filling the formula down through the column would result in all of the URL tags you'd need.

I used this method to create this page, which contains a table with 1250+ links, in a matter of an hour or so. All I had to do was to figure out how to get the article numbers into the worksheet; once I did that, figuring out the formula to generate the correct HTML code was easy. Once that was done, I just copied the HTML code and pasted it into my HTML editor.
 
clayj said:
All I had to do was to figure out how to get the article numbers into the worksheet;.

This can be easily done by selecting all files in the folder (Command + A) copying them, and then pasting into an Excel sheet.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.