Friday, July 31, 2009

Another perl question- file listing to html?

I have a tab delimited file listing which included file attributes and some other data. The first field will be the file name. I would like to find a perl script that would convert the first field to an html link to the actual file. I would like to convert the file listing into an excel spreadsheet or html page so the user can look at the listing and the attributes and just click on the file he /she is interested in. I would keep the files and the file listing in the same folder. This is in windows by the way.

Another perl question- file listing to html?
use strict; use warnings;


use CGI qw(:standard);


print start_html;


open(FILE,'%26lt;','filename') or die;


my $sRows = '';


while (my $s = %26lt;FILE%26gt;)


{


my @as = split(/\t/, $s);


$as[0] = a({href=%26gt;


"http://server.com/dir/$as[0]"}, $as[0]);


$sRow .= Tr(td(\@as));


} # while


print table($sRows);


print end_html;


No comments:

Post a Comment