Simple.
#-- Start Perl Script
my $database = "c:\\tmp\\database.txt";
open(F,$database);
@data = <F>;
close(F);
foreach (@data) {
chomp($_);
@fields = split(/\|/,$_);
print "<tr>", "\n";
for ($i=0;$i<$#fields;$i++) {
print "<td>" . $fields[$i] . "<\/td>";
}
print "<\/tr>";
}
#-- End Perl Script
> -----Original Message-----
> From: mmollenkopf [SMTP:[EMAIL PROTECTED]]
> Sent: 11/11/2000 7:46
> To: [EMAIL PROTECTED]
> Subject: Pipe Delimited Text file Database (arrg!)
>
> All,
> I am Trying to write a script to convert a newline 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 Gamecocks
> 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]
>
>
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web