Thread CSV in CGI ausgeben (7 answers)
Opened by lolipop 999 at 2006-09-16 11:59

pq
 2006-09-16 12:41
#8685 #8685
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
komplett ungetestet:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use Text::CSV_XS;
use CGI;
my $cgi = CGI->new;
my $csv = Text::CSV_XS->new();
open my $fh, "<", "datei.csv" or die $!;
print $cgi->start_table;
while (my $line = <$fh>) {
my $status = $csv->parse($line);
my @columns = $csv->fields();
print $cgi->Tr( map {
  $cgi->td($_)
} @columns;
}
print $cgi->end_table;
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread CSV in CGI ausgeben