Changeset 2600 for trunk/gsdl/bin/script/gsConvert.pl
- Timestamp:
- 2001-06-20T16:52:39+12:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gsConvert.pl
r2574 r2600 399 399 } 400 400 401 # this will probably give a warning under windows... 402 &util::rm("$output_filestem.err"); 401 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 403 402 404 403 # Was the conversion successful? … … 506 505 $cmd .= " 2> $output_filestem.err"; 507 506 $!=0; 507 508 508 my $retcode=system($cmd); 509 509 $retcode = $? >> 8; # see man perlfunc - system for this... … … 610 610 close OUT; 611 611 } 612 # wrap the text - use a minimum length. ie, first space after this length. 613 my $wrap_length=72; 614 &util::mv("$output_filestem.text", "$output_filestem.text.tmp"); 615 open INFILE, "$output_filestem.text.tmp" || 616 die "Couldn't open file: $!"; 617 open OUTFILE, ">$output_filestem.text" || 618 die "Couldn't open file for writing: $!"; 619 my $line=""; 620 while ($line=<INFILE>) { 621 while (length($line)>0) { 622 if (length($line)>$wrap_length) { 623 $line =~ s/^(.{$wrap_length}[^\s]*)\s*//; 624 print OUTFILE "$1\n"; 625 } else { 626 print OUTFILE "$line"; 627 $line=""; 628 } 629 } 630 } 631 close INFILE; 632 close OUTFILE; 633 &util::rm("$output_filestem.text.tmp"); 634 612 635 &util::rm("$output_filestem.err") if (-e "$output_filestem.err"); 613 636 return 1;
Note:
See TracChangeset
for help on using the changeset viewer.