@REM 数値の途中に区切りをいれる
@echo off
REM #jww
REM #cd
REM #zz
REM #zc
REM #h3
REM #hc文字を範囲選択してください
REM #c区切りを入れる桁数 無指定 : 3桁毎 /_/a
REM #c区切文字の入力 無指定 : コンマ( , ) /_/b
REM #e
copy jwc_temp.txt temp.txt > nul
ruby -Ks 区切文字.rb temp.txt %1 %2 > jwc_temp.txt
puts "hd"
$kugiri="3"
$moji="\,"
while ARGV.size > 1
case argument=ARGV.pop
when /\/a/
$kugiri=argument[2..-1]
when /\/b/
$moji=argument[2..-1]
if argument[2..-1]==""
$moji="\s"
end
end
end
def conma(s,i,w)
hash1={"0"=>"0","1"=>"1","2"=>"2","3"=>"3","4"=>"4","5"=>"5",
"6"=>"6","7"=>"7","8"=>"8","9"=>"9","."=>".",","=>",",
"+"=>"+","−"=>"-","__"=>"_"," "=>" "}
if s=~/^\d|^-/ or hash1.key?(s[0,2])
if s=~/\./ or s=~/./
moji=$`
ika=$&+$'
else
moji=s
ika=""
end
moji.tr!("#{w}\_\,\s,, ","")
a=moji.split('')
if a[0,1].size==2
0.upto(a.size-1){|i|a[i]=hash1[a[i]]}
end
a.reverse!
n=0;b=[]
a.each{|item|n!=0 && n%(i.to_i)==0 ? b<<(item+w):b<<(item)
n+=1}
if hash1.key?(s[0])
hash2=hash1.invert
0.upto(b.size-1){|i|b[i]=hash2[b[i]]}
end
return(b.reverse.join+ika)
else
return s
end
end
while ARGF.gets
xy=split
if xy[0]=~/^hq/
elsif xy[0]=~/^ch|^cs/
if $_=~/\"/
moji=$'.chop
puts ($`+$&+conma(moji,$kugiri,$moji))
end