Changeset 2991
- Timestamp:
- 2002-02-21T17:16:28+13:00 (22 years ago)
- Location:
- trunk/gsdl/bin/script
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gsConvert.pl
r2977 r2991 60 60 print STDERR " or text using third-party programs.\n\n"; 61 61 print STDERR " usage: $0 [options] filename\n"; 62 print STDERR " options:\n\t-type\tdoc|pdf|ps|ppt|rtf \t(input file type)\n";62 print STDERR " options:\n\t-type\tdoc|pdf|ps|ppt|rtf|xls\t(input file type)\n"; 63 63 print STDERR "\t-errlog\t<filename>\t(append err messages)\n"; 64 64 print STDERR "\t-output\thtml|text\n"; … … 77 77 # read command-line arguments 78 78 if (!parsargv::parse(\@ARGV, 79 'type/(doc|pdf|ps|ppt|rtf )/', \$input_type,79 'type/(doc|pdf|ps|ppt|rtf|xls)/', \$input_type, 80 80 '/errlog/.*/', \$faillogfile, 81 81 'output/(html|text)/', \$output_type, … … 136 136 print "\n"; 137 137 } 138 elsif ($input_type eq "xls") { 139 print &convertXLS($input_filename, $output_filestem, $output_type); 140 print "\n"; 141 } 138 142 else { 139 143 print STDERR "Error: Unable to convert type '$input_type'\n"; … … 311 315 if (system($cmd)!=0) 312 316 { 313 print STDERR "Powerpoint converter failed $!\n"; 317 print STDERR "Powerpoint 95/97 converter failed $!\n"; 318 } else { 319 return "html"; 320 } 321 } 322 323 $success = &any_to_text($input_filename, $output_filestem); 324 if ($success) { 325 return "text"; 326 } 327 328 return "fail"; 329 } 330 331 332 sub convertXLS { 333 my ($input_filename, $output_filestem, $output_type) = @_; 334 335 my $success = 0; 336 337 # Attempt conversion to HTML 338 if (!$output_type || ($output_type =~ /html/i)) { 339 # formulate the command 340 $cmd = ""; 341 $cmd .= "perl -S xlstohtml.pl "; 342 $cmd .= " \"$input_filename\" \"$output_filestem.html\""; 343 $cmd .= " 2>\"$output_filestem.err\"" 344 if ($ENV{'GSDLOS'} !~ /^windows$/i || $is_winnt_2000); 345 346 347 # execute the command 348 $!=0; 349 if (system($cmd)!=0) 350 { 351 print STDERR "Excel 95/97 converter failed $!\n"; 314 352 } else { 315 353 return "html";
Note:
See TracChangeset
for help on using the changeset viewer.