From WikiChip
Editing mirc/commands/filter

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 12: Line 12:
 
== Switches ==
 
== Switches ==
 
=== Source/Destination switches ===
 
=== Source/Destination switches ===
Source and destination switches are (in theory) only needed if either the source or destination is ambiguous, but it is recommended that you always explicitly define both source and destination. The first use of these indicates the source, the second indicates the destination. As long as you're using a @window as your input or output and the other part of the input/output pair is a filename that does not begin with "@" then the -fw switches are not needed. They are needed with -s and -d to indicate which are input/output. Can use the window-id as an alias for the @custom window name. @test can be replaced by $+(@,$window(@test).wid)
+
Source and destination switches are (in theory) only needed if either the source or destination is ambiguous, but it is recommended that you always explicitly define both source and destination. The first use of these indicates the source, the second indicates the destination.
 
* '''-w''' - source/destination is a custom-window
 
* '''-w''' - source/destination is a custom-window
 
* '''-f''' - source/destination is a file
 
* '''-f''' - source/destination is a file
Line 49: Line 49:
 
<syntaxhighlight lang="mIRC">;filter from the file "c:\my file.txt" to the custom window @mywin
 
<syntaxhighlight lang="mIRC">;filter from the file "c:\my file.txt" to the custom window @mywin
 
/filter -fw "c:\my file.txt" @mywin *findthis*
 
/filter -fw "c:\my file.txt" @mywin *findthis*
 
 
;filter from the custom window @mywin to the file "c:\my file.txt"
 
;filter from the custom window @mywin to the file "c:\my file.txt"
 
filter -wf @mywin "c:\my file.txt" *findthat*
 
filter -wf @mywin "c:\my file.txt" *findthat*
 
 
;filter from the status window to the single message window
 
;filter from the status window to the single message window
 
/filter -sd *findthis*
 
/filter -sd *findthis*
 
 
;filter from the single message window to the status window
 
;filter from the single message window to the status window
 
/filter -ds *findthat*
 
/filter -ds *findthat*
 
 
;filter from the filename @this_is_a_file to the dialog 'dialog', id '1'
 
;filter from the filename @this_is_a_file to the dialog 'dialog', id '1'
 
/filter -fo @this_is_a_file dialog 1 *findthis*
 
/filter -fo @this_is_a_file dialog 1 *findthis*
 
 
;filter from a file and call an alias for each line
 
;filter from a file and call an alias for each line
 
/filter -fk file myalias *findthat*
 
/filter -fk file myalias *findthat*
 
+
;filter from a file to a file using regex
;Fetch list of mIRC release dates from versions.txt to status window:
+
/filter -ffg file1 file2 /regex here/
/filter -fsg versions.txt \d+/\d+/\d+ - mIRC*
 
; same except looks only at lines 1-through-1000 and prefixes returned text with the line number:
 
/filter -fsgrn 1-1000 versions.txt \d+/\d+/\d+ - mIRC*
 
 
 
;filter from a wordlist file to status window for words which can be spelled in an 8-digit CRC, using regex
 
; includes substitutions like 7 in place of "t", 0 in place of "0", 8 in place of "ate", etc
 
alias word2hex echo -s $replace($1-,four,4,for,4,ate,8,ten,10,t,7,s,5,to,2,l,1,o,0)
 
/filter -fkcg words_alpha.txt word2hex /^([A-F]|o|l|to|for|four|s|g|t|ate|ten){1,8}$/i
 
 
 
 
;sort by file(same file) - Input file's Column 1 delimited by Space Character $chr(32)
 
;sort by file(same file) - Input file's Column 1 delimited by Space Character $chr(32)
 
/filter -ffcut 1 32 file.txt file.txt  
 
/filter -ffcut 1 32 file.txt file.txt  
 
; can use filter to obtain line count without creating output window/file
 
//filter -fk versions.txt nosuchalias *mirc* | echo -a $filtered lines contain the string mIRC
 
; NUL is the windows device for the 'bit bucket, and creates no such file - not to be confused with the $null identifier
 
//filter -ff versions.txt nul *mirc* | echo -a $filtered lines contain the string mIRC
 
 
 
; If /window -jN not used or created with -j0, size limit of @test is current value of Mirc-Options/Other/WindowBuffer
 
; If /window -jN not used or created with -j0, size limit of @test is current value of Mirc-Options/Other/WindowBuffer
 
//filter -fwc versions.txt @test * | var %missing $calc( $filtered - $line(@test,0)) | if (%missing) echo -a warning %missing of $filtered filtered lines not in @test because /window not used with large enough -jN value
 
//filter -fwc versions.txt @test * | var %missing $calc( $filtered - $line(@test,0)) | if (%missing) echo -a warning %missing of $filtered filtered lines not in @test because /window not used with large enough -jN value
Line 91: Line 71:
  
 
== See also ==
 
== See also ==
 +
* [[List of commands - mIRC|List of commands]]
 +
* [[List of identifiers - mIRC|List of identifiers]]
 
* {{mIRC|$filtered}}
 
* {{mIRC|$filtered}}
* {{mIRC|$read}}
 
* {{mIRC|$fline}}
 
 
* {{mIRC|/loadbuf}}
 
* {{mIRC|/loadbuf}}
 
* {{mIRC|/savebuf}}
 
* {{mIRC|/savebuf}}
 +
{{mIRC command list}}
 +
 +
[[Category:mIRC commands|filter command - mIRC]]

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)