IMPORT CSV WITH NON STANDARD DELIMITED ....

LUCA90 29/08/2009 09:34:38
#321323
Have a txt file in c:\mytext.tx with 123.456 line similar:
aaaaaa*ssssssssssssss*sssssssss*nnnnnnnnnnnnnnnn*mmmmmmmmm
How to import in access table?
aaaaaa in field TEST1
ssssssssssssss in field TEST2
sssssssssin field TEST3
ecc...

the delimited character is [Ô]*[Ô]

i dont know if is possible with ado or not.
Tks for assistence and sorry for my bad english;-)
JESUEL.OLIVEIRA 29/08/2009 10:15:18
#321326
Speech friend.

VBMANIA icephantom we see the solution below.

Just change the character ; so you use *

      While Not EOF(2)
Line Input #2, ltext
sLine = ltext
ParseToArray sLine, A()


  Sub ParseToArray(sLine As String, A() As String)

Dim P As Long, LastPos As Long, I As Long

P = InStr(sLine, [Ô];[Ô])

Do While P
A(I) = Trim(Mid$(sLine, LastPos + 1, P - LastPos - 1))

LastPos = P
I = I + 1
P = InStr(LastPos + 1, sLine, [Ô];[Ô], vbBinaryCompare)
Loop
A(I) = Trim(Mid$(sLine, LastPos + 1))

End Sub
LUCA90 29/08/2009 13:09:31
#321341
ok tks for code..

but:

How to import in access table?
aaaaaa in field TEST1
ssssssssssssss in field TEST2
sssssssssin field TEST3
ecc...
Tópico encerrado , respostas não são mais permitidas