xml to csv converter for ted 5000

Discussion in 'Mac Programming' started by hotshotharry, Oct 5, 2009.

  1. hotshotharry macrumors 6502

    Sep 6, 2007
    I just wanted to share this applescript i made to convert the xml data that can be automatically downloaded to a csv format to be used in excel or numbers.

    This file saves the newly formatted file as a last step, be sure to save it as a new file before you run it if you want to keep the original file!

    To use this script you need to have the minutehistory.xml file open in textedit. Also you need to open system preferences go to universal access and enable access for assistive devices

    If anyone has some advice on how to make this run in the background that would be great!

    Attached Files:

  2. hotshotharry thread starter macrumors 6502

    Sep 6, 2007
    ted 5000 automator download workflow

    This is an automator workflow that will download the xml data from the ted 5000 and save a copy to your desktop with time stamps. :)

    Either you will need to change the ip address in the workflow to the address of your ted 5000 unit or change the ip address of your ted 5000 unit to

    Attached Files:

  3. sparker macrumors newbie

    Mar 19, 2006
    Why not just create a shell script that uses wget to extract the .csv directly from the gateway (replace my IP with yours):

    #---------- begin script get-ted-values ----------
    echo "Getting values from TED"
    _time=$(date +%Y%m%d-%H%M%S)
    wget -O "CSV Files/Minutes-MTU0_$_time.csv" ""
    wget -O "CSV Files/Minutes-MTU1_$_time.csv" ""
    wget -O "CSV Files/Hourly-MTU0_$_time.csv" ""
    wget -O "CSV Files/Hourly-MTU1_$_time.csv" ""
    You can repeat the calls for secondhistory, dailyhistory, and monthlyhistory, and set the MTUs appropriately. I don't KNOW for a fact that the "U=1" numbers have to be sequential for each wget since each one will be in a separate session, but I did that in my script.

    I just run the script in the background "get-ted-values &" (the ampersand forces it into the background), and a few seconds later, I have all the .csv files sitting in my directory. If you don't want to see the progress sliders as it works, add a "-a wget.log" option to each wget command that will "append" all that stuff into a wget.log file.


Share This Page