dyno2316 ロヒミフ perl VBA Excel 秀丸

レコードの外字文字列を「〓」に置換

#-------------------------------------------------------
#☆入力ファイルの全レコードの外字文字列を「〓」に置換する
#-------------------------------------------------------
open(FIN,$ARGV[0]) || die "001 can't open $ARGV[0]¥n";
open(FOUT,">$ARGV[1]") || die "002 can't open $ARGV[1]¥n";

while(&ltFIN>)
{
$rec = $_;


$x = pack( "H*", "F040" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F041" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F042" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F043" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F044" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F045" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F046" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F047" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F048" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F049" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04A" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04B" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04C" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04D" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04E" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F04F" ); $rec =‾ s/$x/〓/g;

$x = pack( "H*", "F050" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F051" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F052" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F053" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F054" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F055" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F056" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F057" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F058" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F059" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05A" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05B" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05C" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05D" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05E" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F05F" ); $rec =‾ s/$x/〓/g;

$x = pack( "H*", "F060" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F061" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F062" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F063" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F064" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F065" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F066" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F067" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F068" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F069" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06A" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06B" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06C" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06D" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06E" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F06F" ); $rec =‾ s/$x/〓/g;

$x = pack( "H*", "F070" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F071" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F072" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F073" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F074" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F075" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F076" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F077" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F078" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F079" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07A" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07B" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07C" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07D" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07E" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F07F" ); $rec =‾ s/$x/〓/g;

$x = pack( "H*", "F080" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F081" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F082" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F083" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F084" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F085" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F086" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F087" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F088" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F089" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08A" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08B" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08C" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08D" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08E" ); $rec =‾ s/$x/〓/g;
$x = pack( "H*", "F08F" ); $rec =‾ s/$x/〓/g;


print $rec;
print FOUT $rec;
}

close(FOUT);
close(FIN);