@REM 既存文字に連番を付加する(連続99個まで) @echo off REM #jww REM #cd REM #zc REM #1ch文字を指示してください REM #99# REM #k|1)半角(L)|2)全角(R)|/_/a REM #c最初の数値を入力してください 無指定:1/_/b REM #e copy jwc_temp.txt temp.txt > nul ruby -x %~f0 temp.txt %1 %2> jwc_temp.txt exit #!ruby -Ks require 'jcode' han_zen="1" no=1 while ARGV.size>1 case argument=ARGV.pop when /\/a/ han_zen=argument[2..-1] when /\/b/ no=argument[2..-1].to_i end end array=[] while ARGF.gets if $_ =~ /^ch/ array<< $'.chomp if $_ =~ /\"/ end end array.uniq! if array.size>1 word=array.join("\s") puts "h#複数の単語があります 「#{word}」" exit end puts "hd" open("temp.txt","r"){|f| while f.gets if $_ =~ /^hq/ elsif $_ =~ /^ch/ if han_zen == "1" puts $_.chomp+"-#{no}" else puts $_.chomp+"-#{no}".tr("-0123456789","−0123456789") end no += 1 else print $_ end end }