# Last update: 2003/12/16 # # CSV Table to HTML # # (p) J. Nagasaki # # # Converts "simple" n*m csv file to a unformatted HTML table # # INPUT: CSV File (;) named "tab.csv" # OUTPUT: Generated HTML table ( ...
) named "tab.html" # open(FILE, "; close(FILE); @outfile=""; push (@outfile, "\n"); foreach (@infile) { $_ = "\t\n\t\t" push (@outfile, $_); } push (@outfile, "<\/table>"); open(FILE, ">./tab.html"); print FILE @outfile; close(FILE);
".$_; # "
" + first line $_ =~ s/;/<\/td>\n\t\t/gi; # replace ; with chomp ($_); # remove \n at end $_ .= "<\/td>\n\t<\/tr>\n"; # line + "