ennas
03-29-2006, 07:19 AM
I have a txtfile that i want to import in a access table. The textfile has separation of spaces.
This is the code i use.
Open "G:\Students\sanne\test.txt" For Input As #TXTFile
Do While Not EOF(TXTFile)
Line Input #TXTFile, TXTLine
TXTLine = Trim(TXTLine)
rst.AddNew
'rst2.AddNew
' your table field, start position and length would go in next line
' the line is then repeated for each field
rst![Extension] = Trim(Mid(TXTLine, 6, 4))
rst!Total_Cost = Trim(Mid(TXTLine, 19, 7))
rst.Update
Loop
Close #TXTFile
The reading in is good, only it takes space with im.
Have somebody a resolution for this.
Thanks
This is the code i use.
Open "G:\Students\sanne\test.txt" For Input As #TXTFile
Do While Not EOF(TXTFile)
Line Input #TXTFile, TXTLine
TXTLine = Trim(TXTLine)
rst.AddNew
'rst2.AddNew
' your table field, start position and length would go in next line
' the line is then repeated for each field
rst![Extension] = Trim(Mid(TXTLine, 6, 4))
rst!Total_Cost = Trim(Mid(TXTLine, 19, 7))
rst.Update
Loop
Close #TXTFile
The reading in is good, only it takes space with im.
Have somebody a resolution for this.
Thanks