Menu

#52 Log To CSV

PredictionMarkets
open
Experiment (4)
5
2009-10-20
2009-10-20
Anonymous
No

Hello,In Zocalo PM how can I let log to CSV?
Anyone can teach me how to do?

Thanks.

Discussion

  • Chris Hibbert

    Chris Hibbert - 2009-10-20

    There are two configurations of Zocalo, the prediction markets (PM) and experiments (exp). The question says "PM", but the category says experiments, so I'm not sure which you're talking about, so I'll answer both. In the Experiments version, you should get links at the end of an experiment session to download the raw log file (worth saving this file, since it has more details than the CSV file, and can be reprocessed later if there are bugs in the CSV script), or to produce a processed table for CSV or a web page. This feature may not work for servers running on Windows in recent releases. Let me know if you're having problems on a windows machine, and I can walk you through the process. If you've saved the log file, you should also be able to follow the process described for the PM version.

    For the PM version, you have to manually invoke the logToCSV.pl script from a command line. Either from a shell on unix/Mac, or a command tool on Windows. On Unix or Mac, you make .../zocalo your current directory (so typing "ls" shows the directories "bin", "logs", and "etc".) Then, if you want a CSV for logs/Oct-11-monopsony-701966247.log, you type
    bin/logToCSV.pl logs/Oct-11-monopsony-701966247.log > logs/Oct-11-monopsony-701966247.CSV

    with the PM configuration, you can also get a report on trades for a claim called "Obama" by typing:
    bin/tradesToCSV.sh Obama > logs/Oct20-Obama.CSV

     
  • kimifinal

    kimifinal - 2009-10-21

    Sorry. I select wrong category. My question is about Zocalo 2009.1-PM.
    My operation system is Windows. I try some way to let logToCSV but it not work.
    According to your suggestion,it seems logToCSV.pl is not working in Windows.
    Could you point me type right command line in Windows?
    And how can I use this file "tradesToCSV.bat"?

    Thanks.

     
  • Chris Hibbert

    Chris Hibbert - 2009-10-21

    I recently fixed this for a user of the experiments configuration, but it ought to work for the prediction market configuration. Apparently there are no instructions included for using the script. I'll find a place to add them.

    With a command window whose current directory is zocalo, if your log file is logs/Aug.6-GMU-701966247665801848.log, you can type

    perl logToCSV.pl logs/Aug.6-GMU-701966247665801848.log > Aug6-GMU.csv

    If it complains that it doesn't know where perl is, you may have to install a copy. Try this one: http://strawberryperl.com/ . Once you have it installed "perl" should work as a command; if not, you may have to add it to your path. control panels>>system>>advanced lets you edit PATH and PATHEXT, both of which affect this. Let me know if you have trouble and I'll write up more detailed instructions.

    [if the command above doesn't work, try
    perl logToCSV.pl logs\Aug.6-GMU-701966247665801848.log > Aug6-GMU.csv
    but the one with the forward slashes worked for me.]

     
  • Chris Hibbert

    Chris Hibbert - 2009-10-21

    Oh, yeah. You also asked about tradesToCSV.bat. If you've created and traded in a market called "ObamaCare2010", then you should be able to run that command in a command window which has zocalo as its current directory. Type
    bin\tradesToCSV.bat ObamaCare2010 > ObamaCare2010.csv
    and you should get a .csv file that excel (or other programs) can read.

     
  • kimifinal

    kimifinal - 2009-10-22

    Those problems are solved. It's very helpful. I deeply appreciate your help.

     

Log in to post a comment.