- 5ch秀丸スレで連番を展開できないかって話題が出たので作ってみる。
- rubyをインストールして利用して下さい。
- ruby 2.6.5p114 にて動作確認してます。
- ……[1-10].htmlをのようなのを ……1.html,……2.html,……,……10.htmlのような形で展開します。
//数字展開.mac
disabledraw;begingroupundo;
if(!selecting)selectall;
cut;
openfile "/h";paste;
saveas currentmacrodirectory+"\\tmp1.txt";
#h=hidemaruhandle(0);
setactivehidemaru 1;
closehidemaruforced #h;
runsync2 "rubyw -x "+currentmacrofilename;
insertfile "tmp2.txt";
enabledraw;endgroupundo;endmacro;
/*
#/
#! ruby
$stdout=open("tmp.txt","w")
$stderr=open("tmp_err.txt","w")
t1=open("tmp1.txt").read
t2=open("tmp2.txt","w")
t1=t1.gsub(%r|(.*)\[(\d+)-(\d+)\](.*)|){|s|
s1=$1;d1=$2.to_i;d2=$3.to_i;s2=$4;s3=""
if d1<d2
(d1..d2).each{|e| s3+=s1+e.to_s+s2+"\n"}
s=s3
end
s}
t2.print t1
__END__
*/
コメント