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

TEXT SHIFTING DURING IMPORT

Status
Not open for further replies.

acct98

IS-IT--Management
Aug 15, 2002
194
US
I have viewed a text file using textpad and all of the columns line up. Nevertheless, after doing an import of the text file into Access the position of the previous lined up columns have shifted. Does anyone have any ideas why this is happending? I tried the import specifications and the results are still the same.
 
Hi

Have you imported it into a multi column table ie one column for each column of the txt file, or have you just imported each text file line into a single column row of a table?



Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
I tried both ways. Each record is about 500 bytes long. I was hoping to import each record into two fields and then break it out by using the substring function. Unfortunately that did not work for me.
 
perhaps you are assuming the end of each line has a Carriage return line feed. Thi swould account for it beeing off a carachtert or two as each line is imported.


you could try some VBA code

Dim MyData As String
Open "c:\myfile" For Input As #1
Do While Not EOF(1)
Line Input #1, MyData
Debug.Print MyData, Len(MyData) '<<<< this will tell you how long the string really is

Loop


DougP, MCP
 
Are your sure the field & record delimiters are what you assumed? If, for instance, the field delimiter is a tab vs a fixed spaceing, the imported information will not appear the same as the text.

search these fora for a routine &quot;basGrabFile&quot; (or at least something similar) and use it to ge the file into an array in memory and carefully inspect the actual (character by character) structure.




MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top