From WikiChip
Difference between revisions of "mirc/commands/write"
m (Bot: Automated text replacement (-<small>Note: Individual switches were not taken into consideration.</small> +)) |
m (Bot: Automated text replacement (-Added On:.+\n?\n?\n?\n?\n? +)) |
||
Line 42: | Line 42: | ||
== Compatibility == | == Compatibility == | ||
Added: mIRC v3.8 | Added: mIRC v3.8 | ||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == |
Revision as of 23:37, 5 July 2014
The /write command can be used to manipulate a text file in various ways. Used without switches mIRC will append the line to the end of the text file. If the file does not exist, mIRC will create it. If <words>, <wildcard>, or <regex> contains spaces, they must be enclosed by a pair of quotes.
Synopsis
/write [-cidna l<line> s<words> w<wildcard> r</regex/>] <filename> [text]
Switches
- -c - Clears the entire file before writing to it
- -i - Inserts the text at a given line instead of replacing it
- -d - Deletes the given line
- -n - Prevent adding $crlf at the end of the text
- -a - Appends the text to an existing line
- -l - Line number for the line to write/modify/delete
- -s - Operates on a file that matched a the scanned <words>
- -w - Operates on a file that matched a the scanned <wildcard> pattern.
- -r - same as -w - but uses a regular expression match
Parameters
- <filename> - The file name to manipulate
- [text] - The text to be written to the file
- <line> - The line number to find
- <words> - The word to scan.
- <wildcard> - Wildcard pattern to match
- </regex/> - RegEx pattern to match
Example
Alias Example { ;Create a file; add a few lines of text to it write Example.txt this is a cool line write Example.txt hello there! write Example.txt text files are cool /* Locate the line that starts with "hello" and insert the following text before it */ write -is"Hello" Example.txt This will become line 2! ;Delete line 1 write -dl1 Example.txt }
Compatibility
Added: mIRC v3.8
See also
mIRC commands list