AC5FF
Registered User.
- Local time
- Today, 04:54
- Joined
- Apr 6, 2004
- Messages
- 552
Hello all; I'm posting this here because I think VBA or Module help will be the easiest way to do what I need to do; but I have ZERO knowledge on using VBA or Modules ...
The easiest part here; is that I am creating something completely new and from scratch so I don't have to work around pre-set tables/formats/etc and can literally build this DB how I want. The issue that I am going to have is getting my data into the database automated. I am trying to eliminate work here and stop people from having to sit at an excel spreadsheet and enter all of this data by hand. Once the data is into Access I am pretty good at manipulating it with queries and creating reports to print out exactly the data that I will need to retrieve.
So; on to the grit of my request. I am needing help to import data from a file into a table. My current system reads in data from external modules and creates saved files as: TXUSE0707.11 where the TXUSE portion is always the same and the 0707.11 is MMDD.YY that the module data is retrieved.
Here is actual data from one of these files:
(actual file would not upload due to the file extention)
Left to right the data tells me:
029-001 = Account Number (will always be XXX-XXX)
-01 = System Number (will always be -XX)
00-02 = Unneeded bits - will ignore this information
.z.z.h.E.-. ... etc = data to save. The charicters between the "." are data where the periods are spacers. There is always 36 columns of data.
.XX . = is the total number of data points for this particular account/system
Initial thoughts of difficulties... The outfiles that my system creates with the modules saves the files as mentioned above. Access itself can't import from an unknown file type. These files may have to be changed to .TXT files. However, the data in the files are exactly as I have pasted above.
Also; the file name changes every time. If I read in my modules today I get a file name of TXUSE0715.11. If I read in a second group of modules today I will get TXUSE0715a.11 - and so forth. I don't want to duplicate imports and I don't want to miss imports into the DB. Both of which could mess up the data accuracy in the end... Could the file name be stored in the DB as well and checked for duplicates before import?
The date information at the top of the data is the date that the module was read. That will have to be entered in to each line. Although this should be easy enough to do - just have to run an update query after import.
So, am i looking at something extremely difficult to do here? I had envisioned a DB with an "Import Now" button that when pressed would look for the a file name with today's date, or the one with the latest date/time stamp?
Now the end all - beats all question. Have I bitten off more than I can chew or can something like this easily be done??
THANKS!
The easiest part here; is that I am creating something completely new and from scratch so I don't have to work around pre-set tables/formats/etc and can literally build this DB how I want. The issue that I am going to have is getting my data into the database automated. I am trying to eliminate work here and stop people from having to sit at an excel spreadsheet and enter all of this data by hand. Once the data is into Access I am pretty good at manipulating it with queries and creating reports to print out exactly the data that I will need to retrieve.
So; on to the grit of my request. I am needing help to import data from a file into a table. My current system reads in data from external modules and creates saved files as: TXUSE0707.11 where the TXUSE portion is always the same and the 0707.11 is MMDD.YY that the module data is retrieved.
Here is actual data from one of these files:
(actual file would not upload due to the file extention)
Code:
AC5FFTMP HIGHEST COUNT INFO
07-07-2011
029-001-01 00-02 .z.z.h.z.z.z.z.z.z.z|z.z.z.z.z.z.-.-.-.-|-.-.-.-.-.-.-.-.-.-|-.-.-.-.-.-. .15 . . . . .
029-001-02 00-00 .z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.h.z.z|z.z.z.z.z.z. .36 . . . . .
029-001-03 00-00 .z.z.z.z.z.z.z.z.z.z|z.z.z.z.z.z.z.z.h.z|z.z.z.z.-.-.-.-.-.-|-.-.-.-.-.-. .24 . . . . .
029-001-04 00-01 .z.z.z.z.z.z.h.z.z.z|z.z.z.z.z.z.z.h.z.z|z.z.z.z.-.-.-.-.-.-|-.-.-.-.-.-. .22 . . . . .
Left to right the data tells me:
029-001 = Account Number (will always be XXX-XXX)
-01 = System Number (will always be -XX)
00-02 = Unneeded bits - will ignore this information
.z.z.h.E.-. ... etc = data to save. The charicters between the "." are data where the periods are spacers. There is always 36 columns of data.
.XX . = is the total number of data points for this particular account/system
Initial thoughts of difficulties... The outfiles that my system creates with the modules saves the files as mentioned above. Access itself can't import from an unknown file type. These files may have to be changed to .TXT files. However, the data in the files are exactly as I have pasted above.
Also; the file name changes every time. If I read in my modules today I get a file name of TXUSE0715.11. If I read in a second group of modules today I will get TXUSE0715a.11 - and so forth. I don't want to duplicate imports and I don't want to miss imports into the DB. Both of which could mess up the data accuracy in the end... Could the file name be stored in the DB as well and checked for duplicates before import?
The date information at the top of the data is the date that the module was read. That will have to be entered in to each line. Although this should be easy enough to do - just have to run an update query after import.
So, am i looking at something extremely difficult to do here? I had envisioned a DB with an "Import Now" button that when pressed would look for the a file name with today's date, or the one with the latest date/time stamp?
Now the end all - beats all question. Have I bitten off more than I can chew or can something like this easily be done??
THANKS!