Difference between revisions of "How to Format a Log Quickly"

From Tenebrae
Jump to navigation Jump to search
Line 2: Line 2:
 
:1. Install [http://notepad-plus-plus.org/download Notepad++] if you haven't.
 
:1. Install [http://notepad-plus-plus.org/download Notepad++] if you haven't.
 
:2. [[NotepadPP Macros|Copy some text]]
 
:2. [[NotepadPP Macros|Copy some text]]
:3. Navigate to: C:\Users\[User]\AppData\Roaming\Notepad++\ * .
+
:3. Navigate to: C:\Users\[User]\AppData\Roaming\Notepad++\ '''*''' .
 
:4. Right-click on Shortcuts.xml, and open with a text editor that is '''NOT''' Notepad++. It is difficult to edit parts of a program well when the program is using them.
 
:4. Right-click on Shortcuts.xml, and open with a text editor that is '''NOT''' Notepad++. It is difficult to edit parts of a program well when the program is using them.
 
:5. Paste the text from Step 2 into Shortcuts.xml, just below where you see:
 
:5. Paste the text from Step 2 into Shortcuts.xml, just below where you see:

Revision as of 10:26, 10 January 2015

Install the Magic Button

1. Install Notepad++ if you haven't.
2. Copy some text
3. Navigate to: C:\Users\[User]\AppData\Roaming\Notepad++\ * .
4. Right-click on Shortcuts.xml, and open with a text editor that is NOT Notepad++. It is difficult to edit parts of a program well when the program is using them.
5. Paste the text from Step 2 into Shortcuts.xml, just below where you see:
<NotepadPlus>
<InternalCommands />
<Macros>
6. Save and close Shortcuts.xml.
7. Open Notepad++. You should see the new macros, located beneath the Macro menu.

* This is a hidden folder. You may need to turn on viewing hidden folders. Also, be sure you are editing the Shortcuts.xml in C:\Users\[User]\AppData\Roaming\Notepad++\, and NOT the one in Program Files. This is a common error! For the love of otyughs, please do not do this thing!


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:

  1. Did you edit the correct Shortcuts.xml file? 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++.
  2. Verify that Shortcuts.xml was edited while Notepad++ was CLOSED.
  3. Verify that the macros were pasted into the correct place in the file (see step 5).

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
Log fr regex.png

^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
Log fr regex.png
^\[[A-Za-z]+\] (.*?)$ Put nothing into Replace (that is, leave it blank)
OOC Chatter
Log fr regex.png
^<OOC> (.*?)$ Put nothing into Replace (that is, leave it blank)
Remove spacing before poses
Log fr regex.png
^\s+ Put nothing into Replace (that is, leave it blank)
Remove excess returns
Log fr extended.png

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
Log fr extended.png
\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.