By |
JCapper excel results with one horse per line |
msammons 10/16/2011 9:53:30 PM | I am just starting with JCapper and HDW files.
After JCapper is run is there a way to export the results in excel with something like one row per horse with each column thereafter having 20 key factors? What I need is the horse name in A1 and then whatever factors I am interested in in cells B1 to M1 for example. But most important is only one line per horse excel setup.
Any help would be greatly appreciated!
|
jeff 10/16/2011 11:15:56 PM | Excel 2003 (255 cells/data fields per record)? --or-- Excel 2007?
Then...
Are you interested in exporting data from a database (after odds and payoffs have been imported?) --or-- Are you interested in export data for today's races - after a Calc Races has been run on one or more race card files that have been loaded into the program?
-jp
.
~Edited by: jeff on: 10/16/2011 at: 11:15:56 PM~
|
msammons 10/17/2011 12:25:11 AM | Excel 2003
This would be for after calculating todays racing card. For the output I need the horse name in A1, and then say CPace, PClass, PMI, CMI, AFR, BF, CFA ... in B1-U1 (20 supporting factors). Then for horse #2 the name in A2 and his factors in B2-U2. But this would need to be for every horse in every race for that day (for 5 tracks it would be say 400 horses (named in A1-A400). Ideally in the end I would have an excel sheet with 400 horses in 400 rows of 20 columns of JCapper factors.
|
jeff 10/17/2011 1:28:58 AM | First, Welcome to the JCapper user community.
When you click the Calculate Races button, two comma delimited text files are created on your current active data folder (as set in the DFM.)
The first file is named ForBill.txt. It contains raw JCapper data about the horses in each race. The second file is named ForJeff.txt. The field mapping is identical for both files. The difference between the two files is that the ForJeff.txt file contains data indicating the UDM names that happen to be flagging each horse - while the ForBill.txt file contains raw data only.
Excel 2003 is limited to 255 data fields per horse record.
(Naturally) both text files have more data fields per record than that.
Here is a link to the field mapping of the ForBill.txt file: http://www.jcapper.com/HelpDocs/ForBillDoc.htm
Towards the bottom of the web page at the above link, you'll find source code for a simple VB or VBA program that can be modified to enable you to use the ForBill.txt file as a data source to create a custom comma delimited text file to be imported into your Excel Spreadsheet.
Excel 2003 is VBA enabled - meaning that the source code found at the above link can be made part of the spreadsheet itself (provided you know what you are doing and/or are willing to spend some time using Google to search for phrases like:
"adding VBA code to Excel 2003"
The other option, if you have Access on your machine, would be the StartersToday table in the c:\JCapper\Exe\JCapper2.mdb file.
That table gets populated with JCapper data during a Calc Races routine whenever you are operating in sql mode.
Because it's an Access table, it is limited to 255 data fields per record - meaning that if after running a Calc Races in sql mode - if you open the file in Access - and the open the StartersToday table, you should be able to CTRL-A to highlight and then CTRL-C to copy all records in the table to the Windows clipboard - and from there CTRL-V to paste them into Excel.
The data structure of the StartersToday table is very close (but not identical) to the published field mapping of the StarterHistory table found in the Table Schema Doc here: http://www.jcapper.com/helpdocs/starterhistorytableschema.html
Hint: If you know your way around Access and open up the table in design view (be careful not to alter the data field structure) - after seeing the field names - and after seeing the field names in the table schema for the StarterHistory table - you should get an idea as to what data is going into which fields.
The above will help you... IF you know your way around Excel, VBA code, and/or Access.
If that doesn't describe you...
I'm more than willing to help you modify the VBA code designed to handle the ForBill.txt file so that you can have a custom export for your spreadsheet - but I realistically can't get to it until next week.
This week I'm already spoken for. I have visitors in town Mon, Tues, and Wed... as well as the planned release of JCapper Basic due out Thurs or Fri.
But if you can wait until after that - there's no reason that I can't help you modify the VBA code snippet in the ForBill field mapping doc so that you can nail down a custom export for your Excel Spreadsheet.
-jp
.
|
msammons 10/17/2011 8:53:12 AM | I will certainly take you up on your generous offer of assistance next week! I really appreciate it. In the mean time I will become more familiar with JCapper. By the way I have used excel for several years - but not VBA code - and while I do have MS Access 2003 I have never used it (although it seems very similar to excel from a quick glance). Be back in touch next weekend.
Is there any additional info you would need from me? (perhaps factors I need columns for?)
Thank you again for your help.
|