integer proc MultiMatchFilename(string fn,string tokens) integer i for i=1 to NumTokens(tokens," ") if MatchFilename(fn,Lower(GetToken(tokens," ",i))) return(1) endif endfor return(0) end proc main() string kq[2],cf[255] integer o,i,ns,j,del,delcnt string nl[255],f[255],s[6],p[4] PushPosition() BegFile() s=GetText(1,6) f=GetText(CurrLineLen()-5,6) PopPosition() if not(s=="File: " and f==" lines") goto OVER endif kq="" if not Ask("Keep/Quit filelist matched wildcard (k|q)?",kq) goto OVER endif if not(kq[1]=='k' or kq[1]=='q') goto OVER endif if kq[1]=='k' p="Keep" else p="Quit" endif cf=GetHistoryStr(17,1) if cf=="" cf="*.h" endif if not Ask(p+" FilePathNameExt Wildcard?",cf,17) goto OVER endif del=0 delcnt=0 PushPosition() BegFile() while (1) i = CurrLineLen() if i==0 break endif if (i > 255) i = 255 endif nl = GetText(1,i) ns = pos("File:",nl) if (ns == 1) o = pos("occurrences",nl) if (o > 10) f = GetText(1,o-2) f = DelStr(f,1,6) for j=o-2 downto 1 if f[j]==' ' break endif endfor f = SubStr(f,1,j-1) if kq[1]=='k' if not MultiMatchFilename(Lower(f),cf) del=1 else del=0 endif else //kq[1]=='q' if MultiMatchFilename(Lower(f),cf) del=1 else del=0 endif endif endif endif if del DelLine() delcnt=delcnt+1 else if not Down() break endif endif endwhile PopPosition() if delcnt>0 UpdateDisplay(_WINDOW_REFRESH_) MsgBox(Chr(13)+"Delete "+Str(delcnt)+" line(s).") endif OVER: PurgeMacro(CurrMacroFilename()) return() end