Here are some ideas to get you going: read the file into a while loop and split it into an array using the '|' as a delimiter.
If the data is consistent (i.e. the name is always the first, the date is always 4th), you can call the array items by index ($array[0] is the name, $array[3] is the date, etc.). If not, some regex validation may be in order.
Turning it into an HTML can be done by many ways, and the best one depends on what you want to do with the info. As mentioned, more information will help.
| [reply] [d/l] [select] |
Welcome Britney!
Before we proceed: what have you tried? -- show us your program, that's not working and for which you need help.
Consider Show your work
Best Regards
Allan Dystrup | [reply] |
With some hash data to describe what should link to where, you could always do something like this to each line of the file and ultimately render the page (as follows):
my @links = ('colorado-pc','http://colorado:5810',
'pm', 'http://www.perlmonks.org');
my %linkHash = @links;
my @linkKeys = keys %linkHash;
my @lines = ('christine|colorado10|colorado-pc|10/09/08|XP tom|califor
+nia12|go49ers-pc|09/12/08|vista',
'pm');
my $htmlPage = '<html><table>';
foreach my $line (@lines)
{
# substitute links
foreach my $link (@linkKeys)
{
my $tmpLink = aWrap($linkHash{$link},$link);
$line =~ s/$link/$tmpLink)/g;
}
#split the | into table delimeters
$line =~ s/\|/<\\td><td>/g;
# tack on table html code
$line = '<tr><td>'.$line.'</td></tr>';
#add 2 page
$htmlPage .= $line;
}
$htmlPage .= '</table></html>';
print $htmlPage."\n";
sub aWrap {
my $ref = shift;
my $title = shift;
return "<a href='$ref'> $title </a>"
}
It's a bit wordy, but you get the idea.
Update This isn't the best way, but to do that I'd have to know more about what you've already tried/what libs are you using. Till then, this is A way to do things. | [reply] [d/l] |