--- trunk/all2xml.pl 2003/06/23 20:20:32 54 +++ trunk/all2xml.pl 2003/07/04 15:05:23 57 @@ -33,7 +33,7 @@ my $path; # this is name of database -Text::Iconv->raise_error(1); # Conversion errors raise exceptions +Text::Iconv->raise_error(0); # Conversion errors don't raise exceptions # this is encoding of all files on disk, including import_xml/*.xml file and # filter/*.pm files! It will be used to store strings in perl internally! @@ -247,7 +247,7 @@ sub progress { #return if (! $opts{q}); # FIXME my $current = shift; - my $total = shift; + my $total = shift || 1; my $p = int($current * 100 / $total); if ($p != $last_p) { printf STDERR ("%5d / %5d [%-51s] %-2d %% \r",$current,$total,"=" x ($p/2).">", $p ); @@ -297,7 +297,7 @@ my $excel_file = $cfg -> val($database, 'excel_file') || die "$database doesn't have 'excel_file' defined!"; my $sheet = x($config->{sheet}) || die "no sheet in $type.xml"; - my $start_row = x($config->{start_row}) || die "no start_row in $type.xml"; + my $start_row = x($config->{start_row}) - 1 || die "no start_row in $type.xml"; my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($excel_file) || die "can't open Excel file '$excel_file'"; @@ -314,7 +314,7 @@ defined ($oWorksheet) || die "can't find sheet '$sheet' in $excel_file"; my $end_row = x($config->{end_row}) || $oWorksheet->{MaxRow}; - for(my $iR = $oWorksheet->{MinRow} ; defined $end_row && $iR <= $end_row ; $iR++) { + for(my $iR = $start_row ; defined $end_row && $iR <= $end_row ; $iR++) { my $row; for(my $iC = $oWorksheet->{MinCol} ; defined $oWorksheet->{MaxCol} && $iC <= $oWorksheet->{MaxCol} ; $iC++) { my $cell = $oWorksheet->{Cells}[$iR][$iC];