Difference between revisions of "How to Format a Log Quickly"
(105 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | =Install the Magic Button= |
||
− | Logging can be done smoothly. Usually, it is a case of knowing a little advanced Find and Replace. To do this, you will need: |
||
+ | {{TableMain}} |
||
− | * A client that supports logging (Such as [http://simplemu.onlineroleplay.com/download.html SimpleMU] or [http://www.beipmu.com/download/x-index.php BeipMU]) |
||
+ | {{T02}} |
||
− | * A text editor that supports advanced searches ([http://notepad-plus-plus.org/download Notepad++[ if you're using Windows, native editor if using other OS's) |
||
+ | |colspan="2"|Install the Magic Button |
||
+ | |- |
||
+ | |style="background:#ccc;"|'''1. INSTALL''' || ... [http://notepad-plus-plus.org/download Notepad++] if you haven't. |
||
+ | |- |
||
+ | |style="background:#ccc;"|'''2. COPY''' || ... [[NotepadPP Macros|some text]] |
||
+ | |- |
||
+ | |style="background:#ccc;"|'''3. NAVIGATE''' |
||
+ | | ...to C:\Users\[User]\AppData\Roaming\Notepad++\ ('''THIS IS A HIDDEN FOLDER!''') |
||
+ | '''NOT to:''' |
||
− | If you have both of these things, you can edit a log for most MUs within minutes. |
||
+ | C:\Program Files (x86)\Notepad++ ('''THIS IS BAD!''') |
||
− | ==Using Find and Replace== |
||
+ | |- |
||
− | To clean a log in this fashion, you will need to tinker with a few of Find and Replace's more advanced features. Don't worry, though. Just copy and paste what you see in the table below. The table shows you what to search for. When doing this in Notepad++, be sure that (regular expressions: screenshot) is selected. Other native editors should be fine out of the box. |
||
+ | |style="background:#ccc;"|'''4. RIGHT-CLICK ''' |
||
+ | | ...on Shortcuts.xml and '''OPEN''' it in a '''DIFFERENT''' text editor! |
||
+ | |||
+ | '''Editing a program when the program is in use gives an otyugh gas. This will make things magically fail.''' |
||
+ | |||
+ | |- |
||
+ | |style="background:#ccc;"|'''5. PASTE''' |
||
+ | | ...the text from Step 2 into Shortcuts.xml, just below where you see: |
||
+ | ::<NotepadPlus> |
||
+ | ::<nowiki><InternalCommands /></nowiki> |
||
+ | ::<nowiki><Macros></nowiki> |
||
+ | |- |
||
+ | |style="background:#ccc;"|'''6. SAVE AND CLOSE''' || ... Shortcuts.xml. |
||
+ | |- |
||
+ | |style="background:#ccc;"|'''7. OPEN''' || ... Notepad++. You should see the new macros, located beneath the Macro menu. |
||
+ | |||
+ | |} |
||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==Run the Magic Button== |
||
+ | :1. Open your log in Notepad++ |
||
+ | :2. Navigate to the Macro menu, and select the name of the Macro you just imported |
||
+ | :: ''LogCleanOOC'' cleans everything BUT OOC |
||
+ | :: ''LogCleanALL'' cleans everything |
||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==It didn't work!!== |
||
{{TableMain}} |
{{TableMain}} |
||
{{T02}} |
{{T02}} |
||
+ | |colspan="2"|If you do NOT see the macros... |
||
− | |To find... |
||
− | |Place this into Search |
||
− | |Place this into Replace |
||
|- |
|- |
||
+ | |'''Correct Shortcuts.xml?''' |
||
− | |Pages |
||
+ | |There is one under Program Files, and one under AppData. You want to edit the file beneath AppData\Roaming\Notepad++, NOT the file under Program Files\Notepad++. |
||
+ | |- |
||
+ | |'''Permissions issues?''' |
||
+ | |Was Notepad++ closed when you edited Shortcuts.xml? Alternately, do you have permission to write to your AppData folder? |
||
+ | |- |
||
+ | |'''Placed beginning line 4?''' |
||
+ | | Verify that the macros were pasted into the correct place in the file (see step 5). This is usually about line 4. |
||
+ | |} |
||
+ | |||
+ | |||
+ | |||
+ | |||
+ | =How You Do It: Almost Automagically= |
||
+ | To clean a log in this fashion, you will be tinkering with a few of Find and Replace's more advanced features. Don't worry, though. Just copy and paste what you see in the table below. The table shows you what to search for when doing this in [http://notepad-plus-plus.org/download Notepad++]. Linux and Mac text editors should be able to perform similar functions. |
||
+ | |||
+ | Note that when pasting things into the Find field, be sure there are no trailing spaces. Also, you're meant to paste in one line at a time. |
||
+ | |||
+ | {{TableMain}} |
||
+ | {{T01}} |
||
+ | | width="125"|To Find... |
||
+ | |Open Search, and Select... |
||
+ | |Paste This into Find |
||
+ | |Paste this into Replace |
||
+ | |- style="background: #D3E3E3;" |
||
+ | |'''Pages''' |
||
+ | |[[image:log_fr_regex.png|center|125px]] |
||
| |
| |
||
<nowiki>^From afar\, (.*?)$ </nowiki> |
<nowiki>^From afar\, (.*?)$ </nowiki> |
||
+ | |||
− | <nowiki>^[A-Za-z\- (),]+ pages\: (.*?)$</nowiki> |
||
+ | <nowiki>^[A-Za-z\-\'\`]+ pages\: (.*?)$</nowiki> |
||
+ | |||
<nowiki>^Long distance to (.*?)\: (.*?)$</nowiki> |
<nowiki>^Long distance to (.*?)\: (.*?)$</nowiki> |
||
+ | |||
− | <nowiki>^You paged (.*?) with \'(.*?)\'$</nowiki> |
||
+ | <nowiki>^You paged (.*?) with '(.*?)'$</nowiki> |
||
+ | |||
<nowiki>^From afar\, to \((.*?)\)\: (.*?)$</nowiki> |
<nowiki>^From afar\, to \((.*?)\)\: (.*?)$</nowiki> |
||
+ | |||
+ | <nowiki>^To \((.*?)\)\, (.*?) pages: (.*?)$</nowiki> |
||
+ | |||
|Put nothing into Replace (that is, leave it blank) |
|Put nothing into Replace (that is, leave it blank) |
||
|- |
|- |
||
− | |Channel Chatter |
+ | |'''Channel Chatter''' |
+ | |[[image:log_fr_regex.png|center|125px]] |
||
− | | |
||
+ | |<nowiki>^\[[A-Za-z]+\] (.*?)$</nowiki> |
||
− | |Put noting into Replace (that is, leave it blank) |
||
+ | |Put nothing into Replace (that is, leave it blank) |
||
+ | |- style="background: #D3E3E3;" |
||
+ | |'''OOC Chatter''' |
||
+ | |[[image:log_fr_regex.png|center|125px]] |
||
+ | |<nowiki>^<OOC> (.*?)$</nowiki> |
||
+ | |Put nothing into Replace (that is, leave it blank) |
||
|- |
|- |
||
+ | |'''Remove spacing before poses''' |
||
− | |OOC Chatter |
||
+ | |[[image:log_fr_regex.png|center|125px]] |
||
− | | |
||
+ | |<nowiki>^\s+</nowiki> |
||
− | |Put noting into Replace (that is, leave it blank) |
||
− | |- |
||
− | |Add an additional line between paragraphs |
||
− | |\n |
||
− | |\n\n |
||
− | |- |
||
− | |Remove spacing before poses |
||
− | |Type "space" 9 times |
||
|Put nothing into Replace (that is, leave it blank) |
|Put nothing into Replace (that is, leave it blank) |
||
+ | |- style="background: #D3E3E3;" |
||
+ | |'''Remove excess returns''' |
||
+ | |[[image:Log_fr_extended.png|center|125px]] |
||
+ | |colspan="2"| |
||
+ | 1. Search for \r\n\r\n and replace with \r\n |
||
+ | |||
+ | 2. Do this until you get "0 occurances replaced" in the popup |
||
+ | |- |
||
+ | |'''After doing the above, insert the correct number of returns''' |
||
+ | |[[image:Log_fr_extended.png|center|125px]] |
||
+ | |\r |
||
+ | |\r\r |
||
|} |
|} |
||
+ | |||
+ | |||
+ | =Other OSes= |
||
+ | '''If you're running Linux or Mac:''' Regarding adding additional lines between paragraphs, or removing triple lines: \n and \r stand for New line, and Return, respectively. Depending on your OS, you may need to search for slightly different combinations. Try and see! You're not going to hurt it. |
||
+ | |||
+ | '''Other Options:''' [http://muxlogcleaner.codeplex.com MUX Log Cleaner] is available for Windows, and may be useful on many different MUs. I've not actually tested it. Requires .NET. |
Latest revision as of 06:42, 13 November 2017
Install the Magic Button
Install the Magic Button | |
1. INSTALL | ... Notepad++ if you haven't. |
2. COPY | ... some text |
3. NAVIGATE | ...to C:\Users\[User]\AppData\Roaming\Notepad++\ (THIS IS A HIDDEN FOLDER!)
NOT to: C:\Program Files (x86)\Notepad++ (THIS IS BAD!) |
4. RIGHT-CLICK | ...on Shortcuts.xml and OPEN it in a DIFFERENT text editor!
Editing a program when the program is in use gives an otyugh gas. This will make things magically fail. |
5. PASTE | ...the text from Step 2 into Shortcuts.xml, just below where you see:
|
6. SAVE AND CLOSE | ... Shortcuts.xml. |
7. OPEN | ... Notepad++. You should see the new macros, located beneath the Macro menu. |
Run the Magic Button
- 1. Open your log in Notepad++
- 2. Navigate to the Macro menu, and select the name of the Macro you just imported
- LogCleanOOC cleans everything BUT OOC
- LogCleanALL cleans everything
It didn't work!!
If you do NOT see the macros... | |
Correct Shortcuts.xml? | There is one under Program Files, and one under AppData. You want to edit the file beneath AppData\Roaming\Notepad++, NOT the file under Program Files\Notepad++. |
Permissions issues? | Was Notepad++ closed when you edited Shortcuts.xml? Alternately, do you have permission to write to your AppData folder? |
Placed beginning line 4? | Verify that the macros were pasted into the correct place in the file (see step 5). This is usually about line 4. |
How You Do It: Almost Automagically
To clean a log in this fashion, you will be tinkering with a few of Find and Replace's more advanced features. Don't worry, though. Just copy and paste what you see in the table below. The table shows you what to search for when doing this in Notepad++. Linux and Mac text editors should be able to perform similar functions.
Note that when pasting things into the Find field, be sure there are no trailing spaces. Also, you're meant to paste in one line at a time.
To Find... | Open Search, and Select... | Paste This into Find | Paste this into Replace |
Pages |
^From afar\, (.*?)$ ^[A-Za-z\-\'\`]+ pages\: (.*?)$ ^Long distance to (.*?)\: (.*?)$ ^You paged (.*?) with '(.*?)'$ ^From afar\, to \((.*?)\)\: (.*?)$ ^To \((.*?)\)\, (.*?) pages: (.*?)$ |
Put nothing into Replace (that is, leave it blank) | |
Channel Chatter | ^\[[A-Za-z]+\] (.*?)$ | Put nothing into Replace (that is, leave it blank) | |
OOC Chatter | ^<OOC> (.*?)$ | Put nothing into Replace (that is, leave it blank) | |
Remove spacing before poses | ^\s+ | Put nothing into Replace (that is, leave it blank) | |
Remove excess returns |
1. Search for \r\n\r\n and replace with \r\n 2. Do this until you get "0 occurances replaced" in the popup | ||
After doing the above, insert the correct number of returns | \r | \r\r |
Other OSes
If you're running Linux or Mac: Regarding adding additional lines between paragraphs, or removing triple lines: \n and \r stand for New line, and Return, respectively. Depending on your OS, you may need to search for slightly different combinations. Try and see! You're not going to hurt it.
Other Options: MUX Log Cleaner is available for Windows, and may be useful on many different MUs. I've not actually tested it. Requires .NET.