|
>行を指定して、何行目から何行目までの範囲でgrep検索可能ですか?
遅いコメントですが,次のようなマクロを使えば,できるかもしれません。
//----------------------------------------------------------//
// 範囲を指定してグレップ
$start = input("開始行");
if( !result ) endmacro;
$last = input("最終行");
if( !result ) endmacro;
if( !selecting ) selectword;
$search = gettext( seltopx, seltopy, selendx, selendy );
#start = val($start);
#last = val($last);
if( #start > #last ) {
#a = #start;
#start = #last;
#last = #a;
}
#soption = searchoption;
$sbuffer = searchbuffer;
setcompatiblemode 0x0200;
$base = basename2;
$file = filename2;
movetolineno 1, #start + 1;
beginsel;
movetolineno 1, #last;
copy;
openfile "/h";
#handle = hidemaruhandle(0);
paste;
grepdialog2 $search, "(現在の内容)", ".";
closehidemaruforced #handle;
disabledraw;
gofiletop;
while( 1 ) {
searchdown2 "(?<=^\\()[0-9]+", regular;
if( !result ) break;
$line = gettext( seltopx, seltopy, selendx, selendy, 1 );
insert str(#start + val($line));
}
if( searchoption & 0x00000400 ) { //フルパス出力
call PlusYen $file;
$base = $$return;
}
replaceallfast "^", $base, regular;
clearupdated;
setsearch $sbuffer, #soption;
endmacro;
PlusYen:
$$s = $$1;
while( 1 ) {
##n = strstr($$s, "\\", ##n);
if( ##n < 0 ) break;
$$s = leftstr($$s, ##n + 1) + "\\" + midstr($$s, ##n + 1, 999);
##n = ##n + 2;
}
return $$s;
//----------------------------------------------------------//
山紫水明(ユーザー)
SANSHISUIMEI
|
|