Originally Posted by
SFC
Thanks ajetrumpet,
Yes, it would work if the user did not use returns put sometimes the imput requires it.
For example,
Color: red
Heght: 36"
From what I can see, there is nothing you can do from an Access standpoint. Here's as close as I can think of ---- run this code on your text file:
Code:
Function ReadFile()
dim fso
dim ofile
dim oContents As string
Set fso = CreateObject("Scripting.FileSystemObject")
Set ofile = fso.OpenTextFile("PATH OF FILE", 1)
oContents = ofile.read(111111)
ofile.Close
Debug.Print Replace(oContents, vbCrLf, "VBCRLF")
Set fso = Nothing
Set ofile = Nothing
End Function
Notice that the result shows you where the line feeds are. These can be interpreted by Visual Basic regardless of how they got into the text file. But how can you know which ones to keep and which ones to toss. If you could figure that out, you could import the file through code and use the relevant "vbcrlf" to differentiate between record breaks. Furthermore, if you file looked something like this:
Code:
Color: red
Heght: 36"
Color: red
Heght: 36"
Color: red
Heght: 36"
all you'd have to do is detect the double line breaks and use code to import it accordingly.