Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing a text file with no extension into an access table.

Status
Not open for further replies.

klgrube

Programmer
May 29, 2002
28
US
Hi!

On the Bureau of Labor Statistics web site ( there is a link to an FTP site (ftp://ftp.bls.gov/pub/time.series/sa) where they make available data files in ascii format that have names like "sa.data.5c.California." There are often three or four files per state, and some of them are quite large. As you can see, these files don't have the standard '.txt' extension, and they have multiple periods in the titles, so ACCESS 2000 won't allow me to link to them or import them.

Interestingly, I can import some of the smaller ones directly into Excel using "Get External Data," but many of the files are too large to import into into Excel.

Microsft has a couple of support articles on this topic, providing two general solutions: changing the registry to add a new extension to the list of acceptable text extensions, or temporarily changing the file name by adding the .txt extension. Neither of these are valid solutions, however, since the files contain multiple "periods" in their names, and the final extension is the state name usually. Additionally, I'm trying to avoid having to manually copy the text file down to a drive here and play with the filenames each month. By the way, I don't know why the bls uses that kind of file naming convention!

My goal is to create a module or procedure that will populate a table that contains the data we need for about 12 states. I want someone to be able to click a button on a form that says "Update Data" and a background process will go out to the ftp site and import selected files into a table for them.

Any suggestions?

Thanks!
Karen Grube
 
Thanks Robert!

I appreciate the referral! However the company charges $185 for their ftp active x control. Honestly, it looks as though their product also does a great deal more than I need it to do. I really just need a solution that I can implement easily for linking to the ftp site and importing their data into an Access table. I'll gladly do this from within a module. I'm just not sure how to code it. Any help would be greatly appreciated.

Thanks!
Karen
 
If all you really need to do is ftp certain files, can you not set up an ftp script and then shell out to ftp using the script switch available under shell. in fact, there is a vb function that will allow you to shell out and wait for the job to complete before returning to Access. Then you can read your text file and update your tables. Or am I missing something and am totally off base. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
An additional comment. I just defined a form without an ocx with just a button. And was able to use your ftp site and download a typical unix constructerd file and rename it to something.txt.

if you will tell me the version of access you are using and your email address, just send me email direct, i will send you the datbase. You will be able to change it to meet your needs. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top