Leser: 1
6 Einträge, 1 Seite |
QuoteFormatter class
Spreadsheet::ParseExcel::Fmt*
Formatter class will convert cell data.
Spreadsheet::ParseExcel includes 2 formatter classes: FmtDefault and FmtJapanese. You can create your own FmtClass as you like.
1 2 3
print $format->FmtString($cell, $workbook), "\n"; print "\n"; print $format->ValFmt($cell, $workbook), "\n";
1
2
3
4
@
[Fri Mar 28 20:48:23 2008] ppppp: Use of uninitialized value in print at ./ppppp line 153.
Datum
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::Utility qw(xls2csv); my $rotate = 0 ; my $filename = 'test.xls'; my $coords = '0-A1:F21'; printf xls2csv( $filename, $coords, $rotate) ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
#!/usr/bin/perl -w use strict; use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::Utility qw(xls2csv); use Text::CSV::Simple; my $file_xls = 'test.xls'; my $workbook = new Spreadsheet::WriteExcel($file_xls); die "Problems creating new Excel file: $!" unless defined $workbook; my $sheet = $workbook -> add_worksheet('Titel_1'); foreach my $col(0..2){ foreach my $row (0..2){ $sheet -> write($row, $col, 'Hi, Mrs'); } } $workbook -> close() or die "Error closing file: $!"; my $rotate = 0 ; my $coords = '0-A1:C3'; my $file_csv='test.csv'; open(File, ">$file_csv"); printf File xls2csv( $file_xls, $coords, $rotate); close(File); my $parser = Text::CSV::Simple->new; my @data = $parser->read_file($file_csv) or die "Problems reading file: $!"; my $file_neu_xls = 'test_neu.xls'; $workbook = new Spreadsheet::WriteExcel($file_neu_xls); die "Problems creating new Excel file: $!" unless defined $workbook; $sheet = $workbook -> add_worksheet('Titel_1'); my $col = 0; foreach my $ref (@data){ my $row = 0; foreach my $cell (@$ref){ $sheet -> write($row++, $col, $cell); } $col++; } $workbook -> close() or die "Error closing file: $!";
6 Einträge, 1 Seite |