Need help working with tab-delimited file

NJudson

Who farted?
Local time
Today, 01:12
Joined
Feb 14, 2002
Messages
297
I want to open a tab-delimited file and lets say search a line for a tab. I looked on the net and found (or thought I found) that the ASCII character for a horizontal tab is CHR(HT). I've tried to use this in my code but when I search the line for tabs it does not find or recognize any. Below part of my code I'm using:

Do Until EOF(1)
Line Input #1, a
For i = 1 To Len(a)
If Mid(a, i, 1) = Chr(HT) Then count = count + 1
If count = 6 Then Exit For
Next i
For j = i To Len(a)
If Mid(a, j, 1) = Chr(HT) Then Exit For
Next j
If Mid(a, i, j - i) <> 0 Then Print #2, a: count = 0
Loop

Is chr(ht) incorrect or does it look like I'm doing something wrong? Thank you for your time in looking at my problem.
 
Thank you very much...just what I was looking for!
 

Users who are viewing this thread

Back
Top Bottom