PDA

View Full Version : DRF .CSV Results


Whirlaway
10-23-2006, 08:00 PM
Interested in whether anyone is using these with MS Access. Seems like you'd have to do some pretty heavy pre-processing to get them into usable form. Importing "as is" just gets you a lot of garbage. "H" records mixed with "S" records, mixed with "E" records, mixed with "F" records. Seems like you need to combine all these records into a single record type to make them usable in Access.

Anyone have a utility they're using? I guess I could write one, but I'm lazy and out of practice.

the_fat_man
10-23-2006, 08:33 PM
Anyone have a utility they're using? I guess I could write one, but I'm lazy and out of practice.

That's my excuse.


I think the problem with the data out there, whether free or otherwise, is that it needs to be TWEAKED (big time).

Maybe the lazy (but capable) should take a hint and start REformatting the data (think of all the possibilities) and then selling it for a profit.

Hell, whatever YOUR creation just name it POWER whatever, and it's sure to sell. Some possibilities: POWER CHARTS (with the NO NEED to ACTUALLY LOOK AT option --TOm would buy these.) etc.

Bris/DRF figure that since they're pretty much (with few exceptions) the only game in town, why work to give people what they want.

Tom
10-23-2006, 08:33 PM
What are drf.cvs files?

As to other data, I haven't come across anyhting that needs any tweaking at all. Unless you are tapping free stuff. Any file I have ever paid for I put into Access or Excel directly. that is what it is desinged to do.

Whirlaway
10-23-2006, 10:09 PM
I'm talking about these (http://www.drf.com/misc/textcharts.html) charts. Basically they have 7 different kinds of records in the same file, so if you import them into excel or access they don't parse because the different record types have different fields.

Tom
10-23-2006, 10:51 PM
I stand corrected. Leave it to DRF! :rolleyes:

Even if they were set up right, I would think they area about 1000% over-priced, but no wit looks like 2000%!

You know, they do the same thing with the WInner's Books on line - I love the idea, but they stick little photos in the html files for sex, and up signals, etc, which slows downloading, makes printing far harder than it should be. DRF obviously is now spying on the competition:lol:.

One has to wonder how they can take soooooo long to come out with things and then come out with them so screwed up.

I got one word for DRF.......BENCHMARKING. Google it.

RedOne
10-23-2006, 11:16 PM
You could Import the file into a Single table in Access (ie "TempImport") then Create Queries on the First field where It would be equal to the RecType (ie "R" or"S", etc).

The first time you would execute "Make Table" queries to create the new tables
(ie "Starters" or "Race"). Then after that you would only have to execute Update Queries to append additional Imports.

Create these queries against "TempImport" for each record type defined create the 5 individual tables.

Whirlaway
10-24-2006, 12:40 AM
Red One thanks for the help. Welcome to the board!

I only have the sample files to work from, but I can't import them into access without generating a lot of errors and ending up with garbage. Also, If it were possible to import them cleanly and then separate them into different tables based on record type, I don't see how to create a relationship between the different tables.

The brisnet charts (http://www.brisnet.com/library/newchart2.txt) are separated into six different files and all the records have track, race number, and date, so a relationship can be built on that basis. The different DRF record types don't have common data.

the_fat_man
10-24-2006, 01:09 AM
You might want to check into this option:
http://www.jdca-racing.com/thoroughbred_horse_racing_products_data.htm

they offer CSV, excel, and access format data files

Not bad in terms of price, either.

The negative, I believe--could be wrong--, is that the data is not available until after the meet.

It's all good otherwise.

K9Pup
10-24-2006, 08:43 AM
Interested in whether anyone is using these with MS Access. Seems like you'd have to do some pretty heavy pre-processing to get them into usable form. Importing "as is" just gets you a lot of garbage. "H" records mixed with "S" records, mixed with "E" records, mixed with "F" records. Seems like you need to combine all these records into a single record type to make them usable in Access.

Anyone have a utility they're using? I guess I could write one, but I'm lazy and out of practice.

The clean solution would be to write some VBA code to do the import. If you don't want/can't do that I would suggest this process....

1. Save the raw file as CSV type file on download
2. Open the file in EXCEL. Excel will separate the fields based on the commas.
3. Select rows of one record type and copy.
4. Paste selected rows to new worksheet
5. Save that worksheet AS A CSV file.
6. Use each record type file for import to Access.

RedOne
10-25-2006, 01:03 AM
Whirlaway thanks for the welcome.

I toolk a look at DRF Chart examples. You could establish a relation fairly easy by following the procedure in message six and then doing a series of multi-table queries using the seven field header rec and the individual tmp tables from procedure six.

Procedure six would give you the following TABLES:
TEMPIMPORT
tmpHeader (recType="H")
tmpRaceData (recType="R")
tmpExoticWageringData (recType='E")
tmpAttendance (recType="A")
tmpComments (recType="C")
tmpFootNotes (recType="F")
tmpStarters (recType="S")

Now do Multi-Tables queries using tmpHeader + the other individual tmpTables The first queries would be made as MakeTable queries yeilding you your final production Tables. You would then convert the Make Table Queries to Update Table queries.

The Multi-Table queries would yeild:
tmpHeader+tmpRaceData = DRF_RACEData
tmpHeader+tmpExoticWagering=DRF_ExoticWagering
tmpHeader+tmpAttendance=DRF_Attendance
tmpHeader+tmpComments=DRF_Comments
tmpHeader+tmpFootNotes= DRF_FootNotes
tmpHeader+tmpStarters=DRF_Starters

Then do DeleteRow queries for all the tmp* tables getting your self ready for your next DRF Chart File. This seems like a lot of steps but could be automated with Access Macros or some not to difficult VBA Code.

This is not the most elegant way of dooing this but gives you the ability to build in the relationship into to the database withot having to write any CODE.

I hope I explained this OK. It easier to do than explain.

Alan Wight
10-25-2006, 11:59 AM
You might want to check into this option:
http://www.jdca-racing.com/thoroughbred_horse_racing_products_data.htm

they offer CSV, excel, and access format data files

Not bad in terms of price, either.

The negative, I believe--could be wrong--, is that the data is not available until after the meet.

It's all good otherwise.


For the record, there are some other negatives:

1. Many tracks not covered. (See list of covered tracks below.)
2. Additional formatting is required. The main one is that lengths ahead will probably need to be converted to lengths behind the leader, depending on your requirements.
3. Class restrictions are not included. For example, whether an allowance race is restricted to nonwinners of one... or nonwinners of two... Same for claiming races.

The price is right though.

Here's the list of tracks covered:
NY - Aqu, Bel, Sar
KY - Churchill, Keeneland, Ellis Park, Turfway Park
CA - Santa Anita, Del Mar, Hollywood Park, Golden Gate, Bay Meadows
TX - Lone Star, Sam Houston, Retama park
NJ - Meadowlands, Mommouth Park, Atlantic City
MD - Pimlico, Laurel
DE - Delaware Park
FL - Gulfstream, Calder
LA - Fair Grounds
AK - Oaklawn Park
WO - Woodbine
AZ - Turf Paradise

the_fat_man
10-25-2006, 02:19 PM
For the record, there are some other negatives:


2. Additional formatting is required. The main one is that lengths ahead will probably need to be converted to lengths behind the leader, depending on your requirements.




TO my knowledge, this is a 'problem' with all of the charts ---except for the Equibase $1.50 special.

Now, it boggles the mind why there are no (other) charts out there that give the lengths BEHIND rather than lengths ahead.

(If you take the sorted data and chart it, you get a clear and very concise view of the race.)

Thus, for me, since I need to sort this data, it doesn't "pay" to "pay":bang: for the base data.

RedOne
10-25-2006, 02:53 PM
Quote
"Now, it boggles the mind why there are no (other) charts out there that give the lengths BEHIND rather than lengths ahead. "

When I was looking at DRF Charts for my other posts here the DRF "Starter" record has fields for both lentghs behind and ahead.

the_fat_man
10-25-2006, 03:08 PM
Quote
"Now, it boggles the mind why there are no (other) charts out there that give the lengths BEHIND rather than lengths ahead. "

When I was looking at DRF Charts for my other posts here the DRF "Starter" record has fields for both lentghs behind and ahead.

what's the cost of that?

I've written code that sorts those fields, so unless they're free......

RonTiller
10-25-2006, 04:39 PM
TO my knowledge, this is a 'problem' with all of the charts ---except for the Equibase $1.50 special. Now, it boggles the mind why there are no (other) charts out there that give the lengths BEHIND rather than lengths ahead.
I'll tread lightly here, as I do not intend this to be an advertisement, but I thought I would correct this inaccuracy. For over 10 years, we have created various charts files and reports with beaten lengths rather than with lengths ahead.

The reason stems from the same sense of incredulity as the_fat_man expressed. We found the lengths ahead versions of the charts very annoying, wondered why they were always published this way (I still don't know) and so we published charts data files and reports with beaten lengths, the way we wanted to see and use them. I have to say that in 10+ years, I have taken 1 phone call from a customer who complained that we did not provide lengths ahead in the "traditional" DRF chart format.

Re: the charts file format issues. The format that the DRF uses is indeed not a user friendly format for non-programmers. However, if one is using Access and VBA, the code to parse out and distribute the records is fairly simple. If one is going to distribute chart data in a single file, one's options are:

1) Do what the DRF did and have multiple record types.

This eliminates all non-programmers from using the data as is. As a programmer, I love this type of file. We use this type of file (though not comma delimited) for binary file charts data, which is intended to be read and parsed by a specific handicapping program.

2) Have just one record type and repeat the race related data on each line of data.

This makes the file very user friendly to non-programmers and is what we do with the HTR comma delimited charts. Importing the data into Access (or any other relational database) is then a snap. However, this solution is not without it's own problems. Because one never knows how many of each exotic wager type there will be, making the exotics data usable (other than merely dsiplaying it) requires some query work, but no programming. Also, huge fields, like the full race conditions and the race footnotes, cannot, as a practical matter, be duplicated on each record.

So multi-file charts files are an alternate way to go. These are the leanest and meanest format, eliminating the duplication problems of (2) and eliminating the non-programmer friendliness of (1). But many people don't want to mess with 3 to 6 files per race card. I personally don't mind. We chose option (2) for HTR to make the process simple as possible for the customers. Maybe the DRF concluded (or presumed) that people with some programming ability would be the primary customers for their comma delimited charts files. On the positive side, handicappers now have lots of options when it comes to chart data - with the exception of easily parsable-into-a-database free data.

Ron Tiller
HDW

Tom
10-25-2006, 05:57 PM
I prefer the way Ron does in his charts. I like the lengths ahead deal when I am reading the DRf charts - makes it easier for me to visualize the race, but for my db work, I want the other way around.l

Alan Wight
10-25-2006, 11:56 PM
It's not multiple record type files per se that is the problem with the DRF csv files, but the fact that the track, date, and race number info make up one of those separate files. BRIS' csv charts, for example, also have multiple files, but they include the date, track and race number fields in each file.

BillW
10-26-2006, 12:01 AM
It's not multiple record type files per se that is the problem with the DRF csv files, but the fact that the track, date, and race number info make up one of those separate files. BRIS' csv charts, for example, also have multiple files, but they include the date, track and race number fields in each file.

What key info do they have in each piece?

kroebuck67
11-16-2006, 03:13 PM
I'm confused....

In the DRF Past Performance Tutorial (http://www.drf.com/flash/drf_pp_tutorial.html), it clearly states that the position-at-call length numbers (the small ones next to the position number) are the lengths behind the leader at that point.

Are you guys telling me (and this is something that the formulator help PDF does NOT make clear) that in the formulator running-line ("track_hr") csv files, the position length (i.e., Field 44: First Call Length, Field 46: Second Call Length) are the lengths ahead of the next horse?
That doesn't make sense.

kroebuck67
11-16-2006, 03:21 PM
I'm confused....

In the DRF Past Performance Tutorial (http://www.drf.com/flash/drf_pp_tutorial.html), it clearly states that the position-at-call length numbers (the small ones next to the position number) are the lengths behind the leader at that point.

Are you guys telling me (and this is something that the formulator help PDF does NOT make clear) that in the formulator running-line ("track_hr") csv files, the position length (i.e., Field 44: First Call Length, Field 46: Second Call Length) are the lengths ahead of the next horse?
That doesn't make sense.

I just realized that you guys are talking about CHART data, sorry! :blush:

njcurveball
11-16-2006, 04:28 PM
I stand corrected. Leave it to DRF! :rolleyes:

Even if they were set up right, I would think they area about 1000% over-priced, but no wit looks like 2000%!

You know, they do the same thing with the WInner's Books on line - I love the idea, but they stick little photos in the html files for sex

I have to take a look at these now. ;)

burrhog
12-03-2006, 03:36 PM
I wrote a progie that will break up the DRF Chart files into separate files that contain keys for normalization.
For primary keys I use [Track][Date] & [Race Number] & [Horse Key]
So, the header file key would be the track with the date concatenated.
The race, exotic, attendance, and footnotes files use track, date and race number concatenated.
The starter file concatenates track, date, race number and the horse key as the primary key.
I built this using the SAR20060727.csv file DRF gives as a sample. There aren’t any comments on this race card so I didn’t create a file – if you sent me a sample with comments I will include them.


Also, this program assumes the order of the record types in the chart.csv are the same as the sample. Again, if the row types are all willy-nilly in the file I can make it accept any order (I just threw this together, now I don’t think I’ll use drf chart files).
Note: I usually just use the post position appended to the track, date, race fields for the entrant key. DRF’s “Horse Key” makes the key pretty stringy…
The created keys for each file are inserted into the record in the second field – so the new field numbers are the original DRF chart field numbers plus one (for fields after 0 - the record type and 1 – the new key).


Email me if you want the executable. I also have an installer package if you want that.


It may be that this won’t fly unless you have the 2.0 .Net Framework. I haven’t tried it on an old machine.


The program will append the stripped out records to new or existing files. The new files will be created in the same directory as the selected chart.csv file.


If you want need something else I can alter this pretty simply.

I’ll probably give you the code if you want it.
keithsjohnston@gmail.com (keithsjohnston@gmail.com)

burrhog
12-05-2006, 09:26 PM
Freeware -
Here are some links to the program I wrote that processes DRF Chart files.
This link goes to the programs “Published (http://gopony.com/download/publish.htm)” install page.
The install button will, uh, install it.

http://gopony.com/download/publish.htm

This link goes to the page where the zipped application and Read Me (http://gopony.com/downloads/DRFChartNormalizerSetupFile.htm) files can be downloaded.

http://gopony.com/downloads/DRFChartNormalizerSetupFile.htm

The application is straightforward. The chart file can be csv, txt or .chart type.
The Read Me file contains all the information about the fields and the keys that are inserted into the new files.
Let me know if you have any problems or want different keys.

You must have the .NET framework intalled to use the published install site.
I don't know if you need the .NET framework to actually run the progie...never tried.

Keith