PDA

View Full Version : First Time Turf in any exports?


JohnB
17th March 2005, 03:47.13 PM
Hello all -

Question - is there a field in any exports for a horse who is running on the turf for the first time? Closest I could find was field 132 in the HX4 export (which alerts to a change in dist/surf from last start), and the last 10 PP lines in HX5, but I couldn't find any fields that simply noted if a horse was making its first start on the turf. Is there a field that I am missing somewhere, or is there no such field in any exports?

Thanks,

John

Donnie
17th March 2005, 09:30.59 PM
you mean like this......<see attachment>?

JohnB
17th March 2005, 10:07.24 PM
That's a heck of a report Donnie - real sharp looking!

That's kind of what I mean - I'd like to check out some breeding/pedigree angles with FTS and first time turf horses, preferably in Access through the exports. Easy to query FTS with the exports, but I didn't see any field in the exports that denoted first time turf horses.

John

Donnie
17th March 2005, 10:15.10 PM
Thanks, John.
That entire report is based in Access...the 1st turf numbers come from an exporter Mike Dee wrote that parses the Comp Trainer report and drops it into an Access table. It is then linked to any of your other tables. So researching 1st time turfers is pretty simple.
You got my email? Drop me a line.

tbrown
17th March 2005, 10:47.54 PM
Q from a programing-challenged user....what do you use to write a program to parse data from a text file? What would I need to learn how to write a parse program, in term of software - can it be done in Access or Excel?

Donnie
18th March 2005, 05:09.53 AM
Tom-
What Mike used was a module (visual basic) in Access. Does a slick job!

MikeDee
18th March 2005, 08:39.27 AM
I did the parser in a VBA module of access. You could use VBA in a stand alone version or any programming language. You could do it in excel and excel supports VBA. In fact it might be easier to do in excel because of the way you can define ranges and then do things in a range of data. In excel I would try to use one page of a spreadsheet for the vba module and the imported text file and put the parsed file in a second page of the spread sheet that can be then imported into an access to a table.

The way I did it was to import the text file into a access table. Each line of the text file is put in a single field.

The module takes the table with the imported text field and goes through it parsing the data and putting the parsed data in a second table in the format of date, track, race pgm no, and then all of the specific data fields that you parse.

The real fun begins when you have to loop through each race and writing the code to figure out when you have done the last horse in a race and the next line starts a new race, and or new track.

The problem with parsing text files is that the data is not always on the line where it is supposed to be, sometimes they will skip putting it on one line and will put it on the next line. Or, the data will not appear on the same spot on a line based on how much or little information they have about the horse. Or, if a trainer has not ever raced a horse at a track a portion of the line will just be blank (null in programming terms). Writing the exception (error trapping) code to recognize all of these conditions is very difficult and in some cases beyond my level of expertise. So in some cases all I could do was to output a warning message saying there is a problem here you have to fix the data manually. Hurikane was able to add some additional error trapping routines to improve the program, but it still has some holes in it. You get to a point where you decide the number of times a certain error crops up is not worth the amount of code it would take to trap it.