|
Try the following:
#----------------- # Define
Variables #-----------------
$pbook =
"newtest.dat";
#-------------------- # Display All
Records #-------------------- print "<TABLE>"; print
"<TR><TD colspan='11'><hr
color='red'></TD><TR>";
open (BOOK, $pbook) || do
{&no_open;}; until (eof(BOOK)) { $line = <BOOK>; @entry =
split(/\|/, $line); print "<TR><TD><TABLE
BORDER='1'>";
print "<TR><TD><font face=Arial
size=1>$entry[0]</font></TD><TD><font face=Arial
size=1>$entry[1]</font></TD><TD><font face=Arial
size=1>$entry[2]</font></TD><TD><font face=Arial
size=1>$entry[3]</font></TD><TD><font face=Arial
size=1><a
href='mailto:$entry[4]'>$entry[4]</font></TD><TD><font
face=Arial size=1>$entry[5]</font></TD><TD><font
face=Arial size=1>$entry[6]</font></TD><TD><font
face=Arial size=1>$entry[7]</font></TD><TD><font
face=Arial size=1>$entry[8]</font></TD><TD><font
face=Arial size=1>$entry[11]</font></TD><TD><font
face=Arial size=1>$entry[12]</font></TD></TR>";
print "</TABLE></TD></TR>"; print "<TR><TD
colspan='11'><font face=Arial
size=1>$entry[9]</font></TD><TR>"; print
"<TR><TD colspan='11'><font face=Arial
size=1>$entry[10]</font></TD><TR>"; print
"<TR><TD colspan='11'><hr
color='red'></TD><TR>"; } close(BOOK); print
"</TABLE>";
Rythmist
----- Original Message -----
Sent: Saturday, November 11, 2000 1:19
AM
Subject: Pipe delimited database convert
to HTML table
All, I am Trying to write a script to
convert a newline (record) seperated, 12 field, pipe delimited text file
(database) into ANY readable html table. I have script that kind of works
horizontally but the problem is... 2 of the fields are large (400 character
textareas from a web form), which blow the table out of proportion and make
it difficult to read. Any Thoughts on how to convert Pipe delimited text
database to html...?
Here is an example of A single database
entry:
"973878750|126|Fri Nov 10 09:49:22 2000| Chief R N (registerd
nurse KELLY|[EMAIL PROTECTED]|555-5555|45
A|immediate|121200 DEC 00|The Dolphins would win the tiebreaker and then face
the SEC West champion the first weekend in December for a spot in the BCS. The
Gators might be able to secure an at-large berth even with a loss|The Silver
bird could secure an at-large berth even with a loss|Administrator
Molle|122300 DEC 00"
Thanks for ANY HELP! :>) BigAL
Sends...
V/R, Alan Mollenkopf [EMAIL PROTECTED]
|