|
hrogawaさん,こんにちは。
》今回は,テキストの中から同じ文字が入っている数を数えたいと思っています。
問題解決されましたか?
もし,同一行の数を数えたいということであれば,次のマクロでできると思い
ます。ただし,ファイルサイズや1行文字数に制限はあると思いますが。
//----------------------------------------------------------
#handle1 = hidemaruhandle(0);
run "sort < con > con";
config "w1000"; //最新のβ版なら 2000 も可能
#handle2 = hidemaruhandle(0);
disabledraw;
gofiletop;
while( code != eof ) {
$s = gettext( 0, y, linelen, y );
#i = 1;
down;
while( 1 ) {
if( gettext( 0, y, linelen, y ) == $s ) #i = #i + 1;
else break;
down;
}
$ss = $ss + $s + "\t" + str(#i) + "\n";
}
setactivehidemaru #handle1;
closehidemaru #handle2;
message $ss;
//あるいは以下2行
//gofileend;
//insert "\n" + $ss;
endmacro;
//----------------------------------------------------------
では, (^^)/~
山紫水明
|
|