data cut off


G

Guest

Hello;

I have a data stream that I am reading from a .txt file.
I am trying to write code that will allow me to find an exact match in
several files.

I have a line of data that is getting cut off.
CAP, AIR STEM ASSEMBLY

When I check the search string is CAP
the comma, I think is a cut character for parseing.
How do I get around this.. and keep the search/find string entact.

I open the file the standard way...
open filename as input #1
input #1 mystring

I am new to coding, so examples will be very helpful...

I am running
VB 6.3
office 2003
XP
 
Ad

Advertisements

G

Guest

NickHK

Dim MyString As String
Open "c:\test\book3.txt" For Input As #1 ' Open file for input.
Do While Not EOF(1) ' Loop until end of file.
Input #1, MyString ' Read data
 
N

NickHK

Try Line Input instead (and Freefile):

Dim MyString As String
Dim FF As Long

FF = FreeFile

Open "C:\Book1.csv" For Input As #FF ' Open file for input.
Do While Not EOF(FF) ' Loop until end of file.
Line Input #FF, MyString ' Read data
Debug.Print MyString
Loop
Close #FF

NickHK
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top