Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/perl
- #!/usr/local/ActivePerl-5.6/bin/perl -w
- $infile = $ARGV[0];
- $outfile = "$infile.dc";
- $index = 0;
- open (OUT, ">$outfile" );
- $index = 0;
- open (INF, "$infile") || die (" can not open input file n" );
- print "============After open infile=====================n";
- while(<INF>) {
- if($_ =~ /$index/ )
- {
- chomp $_;
- @temp2 = split (/s+/,$_);
- printf OUT (@temp2);
- # printf OUT ("%-10s %7d %s %7.2f %s %7d %s n",
- # $temp2[5],$temp2[7], $temp2[8], $temp2[9], $temp2[10], $temp2[11], $temp2[12]);
- }
- if ($index < 2000) { $index = $index +1;}
- else {$index = 2000;}
- } # whole
- # } # for
- close (INF) || die "cannot close input file !!";
- close (OUT);
- #rename("$outfile1", "$infile.txt");
- print " data is in $outfile. nn";
Add Comment
Please, Sign In to add comment