View Full Version : importing data into tables
glenn
31st May 2001, 10:00.31 PM
New member here so please excuse the simplicity of these questions that I am sure are very basic to you professionals.
1) When importing data into tables I am duplicating all records over existing tables when I only want to add the most current days data to the existing table. How do you just get the most current days data without just deleting a table and creating a completely new table.
2) A housekeeping question here. Since it appears that all files flow to the htrdata folder, is there any reason not to delete the files from the htr folder when you feel like you won't need them any more. (In other words you have handicapped the card, updated the modeler, updated tables in Access and shouldn't be needing data any longer. Of course if for some reason you do it appears you can go to htr folder to retrieve it anyway.)
Very excited to delve into the HTR world. Thanks
Carl
31st May 2001, 11:02.20 PM
Hi Glenn and welcome.
Usually Mike or Rick answer these types of questions, but I'll try. If I don't make sense they'll hopefully post to straighten me out. So if that happens, ignore my response, go with what they say.
1) I import into access from my "ALL_MSAC" file. What I do is open that up after I am done importing the day's information and delete it, then it fills up again when I do my next send over for download from the MSAC Exporter.
2) About deleting old data permanently. "You never know". When we got our new program IMPACT in in January, I wouldn't have minded some of last year's spring race files to put in to test patterns out, but I had already gotten rid of them. Easiest way to save is to re-label your Htrdata folder at some point when it gets filled up, then you still have the files there if you need them later. Mike and Ernie both explain all this stuff good, about what goes where when, If you do a search in the old files they talk about it a few times.
Hope this helps. If not, post back. Or post back anyway, what the heck.....
later,
Carl
MikeDee
1st June 2001, 06:52.05 AM
Hi Glenn Welcome Hope you can come to the seminar in Vegas this month. Carl has provided you some good info, I'll chime in to.
When you run the htr_msac program it creates the export with the race files. However the export does not have any results information in it in order for you add the results information you need to wait until the next day and get the results "q" file and charts "c" from hdw. So you need 3 files to from hdw for the complete picture the B, Q, and C.
When either HTR-MSAC and IMPACT build the export they simply append additional data to the existing msac.txt and impc.txt files that you have. If they do not find these files it creates new ones. So if you have some files in your HTR directory and then add the next days files and run the exporter without deleting the existing msac or impct txt files you will get duplicates.
You are correct about HTRDATA . Every file you run through HTR and unzip is put in htr data. So over time htr data will get very large. You need to start thinking now how you wnt to manage this before HTR data takes over your hard drive. The HTR data files are not year specific only month and day so at the end of the year at a minimum you need to rename your HTRdata file to say HTRdata2001 and make a new htrdata for 2002.
If you are going into this for the long haul and are going to use access I recommend that you save your old files. From time to time Ken will introduce new factors and if you want to go back and rebuild your db with the new info you need to have the old files. You can always decide to throw away old data later.
A few weeks ago (I think Cliff) had just joined and asked a few questions. So I finally got smart and saved the Q and A. Here it is, this may answer some questions you havn't asked yet
:)
1) All of the data I have in the HTR directory is also in the HTRDATA directory?....just that one (HTR) has unzipped files, and the other (HTRDATA) has zipped files?
ANS Correct
2) Files have to be in the HTR directory for export to Access? It won't work from the HTRDATA directory? Because they are zipped?
Ans. Correct
3) Is there any way to move files from HTRDATA to HTR directory on a "volume" basis as opposed to the ol' click and drag method? Seems like there used to be a way in DOS to find files with certain characteristics in their name and move them all at once? Can you do this in Windows?
Ans.
There are a number of ways to move files in folders. First get the files in the format of a list they are easier to grab and move. If you want to move all of them in the directory press crtl and A together this will highlight all of the files in htrdata. Put the pointer on the selected area. Press and hold the left mouse key and drag all of the files to HTR. You should see a message that says “moving……”
The way to be selective is to use the tools “find files or folders”. With this you can search on file names for example if you want all of the AQU files you put aqu* in the name. If you want all the files for 3/15 you put in *0315* and you will get all of the files with 0315 in the name. Once it finds the files you can grab all the files it found with crtl A and move to HTR.
4) Can anyone give me their "procedure" for a given day to download all the data and yet still make sure it is available for export to Access on a later date after Results and Charts are downloaded?
Here is how I do it .
Each day I bring in the B and S files in Htr. I explode them with HTR . I wait for the scratches to be posted on the internet then I scratch in HTR and export to Access
As more tracks come on line and I get the scratches I delete the all masc and all impact, and my htr daily tables do the scratches and re-export to access.
If you are relying on queries in HTR to place wagers you need the HTR scratches to redo the rankings so that your filters are looking at the right runners.
At the end of the day or before the next day I delete these files from htr and I delete all of the daily htr files from access. You can delete from htr because when you unzipped them they were put in htrdata.
Once a week I update my files with results. I go to hdw and get the Q and C files for the past week and put these in htr then I go to HTRdata and get the past weeks B and S files and put them in HTR . Since I only have one weeks worth of data in htrdata I just grab them all. Next I run HTR to update all the files with results, scratches and charts. I now run htrmsa and impact and bring into access.
This is the data I append to my master data base. It is what I keep.
5) Does most everyone move the files out of HTRDATA to other folders based on Track, Date, etc?
I save my files by track by year. Carl saves his by month. Each week when I update with results I move the files out of htrdta. So for me HTRdata only contains a weeks worth of data or less at any point in time. You have to keep them by year because HTR does not have the year in the file name and you will end up overwriting your data if you don’t.
Most everyone keeps the zipped version of the original files. I don’t. I keep the unzipped version of the files I keep them in a directory by track and at the end of the year or at the end of that tracks last meet of the year, I zip all of the files for that track into a single file for that track for that year. I keep these files on a portable 2.2gig orb drive.
I use the windows version of Pkzip so it is easy to zip files add files to a ziped file and unzip selected files from a zip file.
good luck
Glen
1st June 2001, 08:57.16 AM
Welcome Glenn. Your gonna have some great fun with the dB research.
hurrikane
1st June 2001, 09:28.02 AM
Welcome Glenn...now the Glen count goes to 2.
Just want to chime in on the export..this idea about the results and duplicate records is very important. As are primary keys in access. Nothing will give erroneous results faster than races without results and dupicate records. Can really kill your bankroll. (that's the sound of experience).
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.