you can count the chars and find the highest number of accurences. if it is a long file this will work very well.<br>
then assume that the highest number is the delimiter.<br>
<br>
it will not be that accurate for small files. but there is always a way to do what you are looking to do.<br>
<br>
if you do the search in ascii then you can find tab and other chars also.<br>
<br>
if you would like more info email me.<br>
<A HREF="mailto:trbrenke@yahoo.com">trbrenke@yahoo.com</A>
wallyw -<br>
<br>
You can do occurrance counting like trbrenke suggested, but you're likely to choose the wrong character (like, picking <space> instead of <tab>.<br>
<br>
I'm afraid this is a case of "You just gotta know".<br>
<br>
Chip H.<br>
Dim delimiter As String<br>
Dim sql_statement As String<br>
<br>
If delimiter = "<space>" Then delimiter = " "<br>
If delimiter = "<tab>" Then delimiter = vbTab<br>
<br>
Do While Not EOF(fnum)<br>
' Read a text line.<br>
Line Input # fnum, text_line<br>
<br>
Do While Len(text_line) > 0<br>
pos = InStr(text_line, delimiter)<br>
If pos = 0 Then<br>
' Add the rest of the line.<br>
sql_statement = sql_statement & _<br>
"'" & text_line & "', "<br>
text_line = ""<br>
Else<br>
<br>
sql_statement = sql_statement & _<br>
"'" & Left$(text_line, pos - 1) & _<br>
"', "<br>
text_line = Mid$(text_line, pos + Len(delimiter))<br>
End If<br>
End If<br>
Loop<br>
<br>
' Remove the last comma.<br>
sql_statement = Left$(sql_statement, Len(sql_statement) - 2) &<br>
""<br>
<br>
List1.AddItem sql_statement<br>
<br>
Loop<br>
<br>
Close fnum<br>
<br>
it's a sample !<br>
<br>
Eric De Decker
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.