Scan A File

By Dabomb on Jan 24, 2006

Right click in any window and click "Scan A File". Select the file you wish to scan, then enter the text you want to scan for.

alias ScanFile {
  window -aEk0 @Scan`File
  clear @Scan`File
  set %fname " $+ $sfile(C:\,Select A File To Scan,Scan) $+ "
  If (. isin $left(%fname,4)) {
    set %temp3 $left(%fname,3) 
    rename %fname $replace(%fname,$left(%fname,3),txt)
  }
  set %text $$?="Text To Find?"
  set %text2 $read(%fname, w, * $+ %text $+ *)
  set %read.number $readn
  set %begin.read.number $calc(%read.number - 10)
  set %end.read.number $calc(%read.number + 10)
  set %total.read.number %begin.read.number $+ - $+ %end.read.number
  loadbuf %total.read.number @Scan`File %fname
  inc %read.number 1
  start1234
}
alias start1234 {
  set %yn $?!="Read Next Set Of Text?"
  If (%yn = $false) { halt }
  If (%yn = $true) {
    If (!$read(!%fname, w, * $+ %text $+ *, %read.number) { echo @Scan`File There Are No Matche(s) Found. | halt }
    unset %yn
    clear @Scan`File
    set %text2 $read(%fname, w, * $+ %text $+ *, %read.number)
    set %read.number $readn
    set %begin.read.number $calc(%read.number - 10)
    set %end.read.number $calc(%read.number + 10)
    set %total.read.number %begin.read.number $+ - $+ %end.read.number
    loadbuf %total.read.number @Scan`File %fname
    inc %read.number 1
  }
  set %yn $?!="Read Next Set Of Text?"
  If (%yn = $false) { halt }
  If (%yn = $true) {
    If (!$read(%fname, w, * $+ %text $+ *, %read.number)) {
      halt
    }
    If ($read(%fname, w, * $+ %text $+ *, %read.number)) {
      start1234
    }
  }
  rename %fname $replace(%fname,$left(%fname,3),%temp3
  unset %yn %fname %read.number %total.read.number %read.number %end.read.number %begin.read.number %text %text2 %temp3
}
menu * {
  Scan A File:/scanfile
}

Comments

Sign in to comment.
`Kazuma   -  Jan 31, 2006

1.0 means Bad, Ripped. I don\'t think it is, so here\'s an 9(Exceptional). I love this,

 Respond  
Gex   -  Jan 25, 2006

ofcrs not useless...and deserve more than 1.0 .. maybe 5 or 6

 Respond  
Dabomb   -  Jan 25, 2006

Good point =\ Useless script or no? You decide oo.

 Respond  
No0ne   -  Jan 24, 2006
  • /if: invalid format (line 27, Tscript.txt)
    I tried mulitiple times with other words that were in were not in the file. Not sure what this error means.
 Respond  
Gex   -  Jan 24, 2006

actually thats the best in it

 Respond  
Yoinx   -  Jan 24, 2006

not quite, this scans the file, and prints the results to the screen. you dont open the file.

 Respond  
Gex   -  Jan 24, 2006

that function is already present using either ctrl + f in mirc or just scanning from the notepad ...

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.