home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
s-gikan2.maizuru-ct.ac.jp
/
s-gikan2.maizuru-ct.ac.jp.zip
/
s-gikan2.maizuru-ct.ac.jp
/
pub
/
NCVCscript
/
remove_space.pl
< prev
next >
Wrap
Perl Script
|
2011-06-22
|
402b
|
18 lines
#! /usr/bin/perl
# NCâfü[â^é╠âÅü[âhè╘é╠âXâyü[âXüAâ^âué≡ìφÅ£é╖éΘâXâNâèâvâg #
# ex.G90 G40 G80 -> G90G40G80 #
$pre_file= $ARGV[0];
$out_file= $ARGV[1];
open(IN,$pre_file);
open(OUT,">$out_file");
while(<IN>){
if(!/^N?[0-9\s]*[\(\%]/){ $_ =~ s/(\S)\s+(\S)/$1$2/g; }
elsif(/(N[0-9]+)[\s]*([\(\%])/){ $_= $1.$2.$'; }
print OUT;
}
close(OUT);
close(IN);