MS Excel Script to read Tomato RStat Files
  • User avatar
    SsCoobyDoO
    -- Senior Member --
    -- Senior Member --
    Posts: 70
    Joined: Fri Jan 06, 2023 12:15 pm

    MS Excel Script to read Tomato RStat Files

    by SsCoobyDoO » Wed Aug 28, 2024 9:14 am

    Hello everyone,

    Updated April 3, 2022
    Re-deigned to read historical data in file if the file rolled over. Thanks @sbsnb

    After trying a number of python scripts that I found elsewhere that claims to read the Tomato Rstat files that Merlin creates to no avail (did not find any script that did not result in some error), I decided to create my own script in Excel VBA.

    The MS Excel workbook with the script is here: https://www.dropbox.com/s/5vucpa3s48e5p ... d.zip?dl=0

    The file is zipped and will need to be unzipped first.

    Using the script is straight forward;

    1. Open the workbook and enable macros (you guys don't me from a hole in the wall, so please make sure you scan the file for bad bugs).

    2. Click on the radio button at the top of the worksheet. An open file dialog box will open and ask you for an UNCOMPRESSED tomato RSTAT file. There are plenty of freeware and shareware archive utilities around that can unzip the *.gz rstat file. I use 7-zip. You can also use gunzip from a terminal window in Merlin to unzip the file. If you go the route of using the routers gunzip, copy the rstat file first and unzip the copy. I have a script that copies a backup of the rstat*.gz file to my NAS nightly.

    3. The script creates a new workbook with the stats from the rstat file loaded. You can then change the units on the drop down box to show the data in Kilobytes, Megabytes, or Gigabytes.

    The Rstat file stores 61 days of daily usage and up to 24 months of monthly usage.

    I make no copyright claim, please feel free to use it as you wish. I just wanted something to get the data out and decided to share the file. If there is a better way of sharing the file, I am open to suggestions.

    Cheers


  • JasonMills
    -- Junior Member --
    -- Junior Member --
    Posts: 23
    Joined: Mon Mar 20, 2023 11:19 pm

    Re: MS Excel Script to read Tomato RStat Files

    by JasonMills » Wed Aug 28, 2024 12:39 pm

    Hello all, I found a bug in the monthly totals (was unaware of how RSTAT writes end of month data).

    Anyway, fixed the addition error and updated the DropBox link.
  • MarissaMcconnell
    -- Junior Member --
    -- Junior Member --
    Posts: 40
    Joined: Mon Aug 15, 2022 10:03 am

    Re: MS Excel Script to read Tomato RStat Files

    by MarissaMcconnell » Wed Aug 28, 2024 12:42 pm

    I saw your post while looking for something, and I get why you'd want to work with Tomato RStat files in Excel. It can be tricky to figure out, but it's worth the effort. I recently found a helpful guide on myexcelonline that breaks down how to read these files step by step. It covers some basic scripting that can help you automate the process. The community there is also super helpful, so if you run into any bumps along the way, you can ask for tips. I’ve found that once you get the hang of it, it opens up many doors for data analysis. Take it one step at a time, and you’ll be a pro in no time!
  • jassiet.ross
    -- Veteran Member --
    -- Veteran Member --
    Posts: 376
    Joined: Fri Sep 13, 2024 6:11 am

    Re: MS Excel Script to read Tomato RStat Files

    by jassiet.ross » Fri Sep 13, 2024 7:26 am

    It’s a great tool for reading Tomato RStat files and converting the data into different units. Just remember to scan the file for any potential issues before enabling macros. For those unfamiliar with unzipping gzipped files, tools like 7-zip or gunzip are helpful. If anyone has suggestions or encounters issues, please share your feedback. Thanks again for contributing this useful resource!

Who is online

Users browsing this forum: No registered users and 13 guests