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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Import fixed width text file

Status
Not open for further replies.

markcharleston

Technical User
Sep 16, 2005
3
US
I have been importing and linking to fixed width text files using Access 2002 but am suddenly having problems. I specify the file I want to import, specify fixed width text file and specify that it should be imported to a new table. I then move the lines that separate the columns to line up with the data. The next screen is where I name each field, specify data type or if I do not want the data in that field imported. Each time I name a column the name changes for all previously named columns and when I specify data type the datatypes of all previous columns changes as well. This has changed recently and I am hoping that there is a simple fix. I have many Access databases set up with multiple link specifications. I can delete the text file I am linked to and replace it with a current text file and everything works well. It's only when I try to link (or import) to a new text file that I run into the problem. My fear is that the solution may be reinstalling Access. If I need to reinstall is there a way to preserve all my link specifications so I do not need to set them all up again?
 
You might try opening the file in Excel and then import the Excel file into Access. I know, you shouldn't have to do that, but when push comes to shove, sometimes doing it the long way can be the quickest.

Not sure why Access does this, but the above work-around worked for me--hopefully it'll work for you.

TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
markcharleston

The same way you import text files you can import speccifications form onother database. Just on Import Objects form, click the Options button to reveal the Import/Export Specs on bottom left corner!

I dont think that reinstalling MS-Access will affect saved mdb files.
 
You might try ignoring the screen (don't change the alignment) and see what happens...

I'm using A2k3 and Acc97 on the same machine. I've noticed when you have a higher version of access installed than '97 it tends to mess up the screen where you draw the lines in '97. However, if I don't touch a spec in '97 or I do it by the numbers by going into advanced (first field width X datatype = ?????), it works as desired but I have to ignore that part of the screen. You may have run into something similar here. If this is the case, my question would be, what did you just install and can you live without it or work around it as I have described?

JerryKlmns gave a good suggestion for saving the specifications.

As for TwoOdd's suggestion of using Excel, it may work... I've just been burned to many times by importing from Excel wanting a datatype of text (say for postal codes or account numbers with leading 0's) and getting a number. On the otherhand importing to Excel, exporting to a CSV and importing the CSV would give you the control to select the datatype.

In any case, good luck. I'm curious to know if you figure it out.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top