Formatting macro for EconInfo.json

A long while ago, we started trimming whitespace from the EconInfo.json file. This saves a marginal amount of space, but makes it harder to read. Many users appreciated being able to easily use this file when making wikis/guides, previewing cosmetics, or creating unique screenshots.

If you use Notepad++, I’ve written up a quick macro you can use to add whitespace/tabbing to the file. This (more-or-less) returns it to its prior state.

<Macro name="EconInfo.json formatter" Ctrl="no" Alt="no" Shift="no" Key="0">
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam='[{&quot;name&quot;:&quot;' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam='[\n{&quot;name&quot;:&quot;' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam='{&quot;name&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam='&#x0009;{\n&#x0009;&#x0009;&quot;name&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;type&quot;:&quot;' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;type&quot;: &quot;' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;description&quot;:&quot;' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;description&quot;: &quot;' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;name_color&quot;:&quot;' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;name_color&quot;: &quot;' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;itemdefid&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;itemdefid&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;marketable&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;marketable&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;scraps&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;scraps&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;item_id&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;item_id&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;item_skin&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;item_skin&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;item_effect&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;item_effect&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam=',&quot;quality&quot;:' />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam=',\n&#x0009;&#x0009;&quot;quality&quot;: ' />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam="},&#x0009;{" />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam="\n&#x0009;},\n&#x0009;{" />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
    <Action type="3" message="1700" wParam="0" lParam="0" sParam="" />
    <Action type="3" message="1601" wParam="0" lParam="0" sParam="}]" />
    <Action type="3" message="1625" wParam="0" lParam="1" sParam="" />
    <Action type="3" message="1602" wParam="0" lParam="0" sParam="\n&#x0009;}\n]" />
    <Action type="3" message="1702" wParam="0" lParam="256" sParam="" />
    <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" />
</Macro>

Notepad++ stores macros to a ...\Program Files\Notepad++\shortcuts.xml configuration file. You can also add premade macros via this file.

After adding a macro to the shortcuts.xml file, open up EconInfo.json in Notepad++. From the top ribbon, select Macro > EconInfo.json formatter. This is a long file and each step of the macro makes a lot of changes, so it may take a few minutes before the macro is finished.

(Note: editing the specific contents of this file will prevent you from joining multiplayer servers. However, just formatting the file with additional whitespace for readability will not cause an issue.)

2 Likes

If u want to reduce file size further u can remove size_Z from all items, and Size_X 1 Size_Y 1 from all 1x1 items :D!

Testing this on Bar_Candy, it went down from 161bytes to 125!!!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.