VB Command for seq files to read to end of record

I am trying to read a flat file out of a VB Access 2007 sub.  I want to be able to read to the end of line and then start parsing the file.

Is there a command in VB for Access 2007 that will allow me to read to the end of line or CR LF characters?

Not all the lines are the same length and so that presents a problem.

Thank you.
rpaaepAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
what is the format of the flat file?
if it is text,

dim s
open "c:\myfiel.txt" for input as #1
do until eof(1)
 line input #1, s
 debug.print s

loop
close #1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rpaaepAuthor Commented:
Hi,

When I did this I got out of string space error message.  It is a text record (csv).

The first record's length is 11657 + 0A(line feed character)  There is no 0D0A for each record as in DOS.  This came from a gov't mainframe I am think or some sort of Unix based box.

The data records are around 1190 + 0A depending on how much data is in the file.

It appears the code above is trying to read the whole text file due to no 0D0A in the record.  In other words, it does not see the 0A as a line terminator.  This is my guess.

The lcLine = INPUT(1200, #3) reads past the 0A and starts to pick up the next record.  

What I need is a way for it to find or recognize the 0A as the end of record so I can process one record at a time.

Any thoughts on this?



0
Rey Obrero (Capricorn1)Commented:
can you upload a sample file? perhaps read it as hex
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

rpaaepAuthor Commented:
The file it is part of is 3gigs so not sure if that would work.

I don't know how to read it as hex but I could read it one character at a time until the 0A is reached then process the record, etc.

If you could give some direction of how to read it as hex or recognize the hex 0A that would be great.
0
Rey Obrero (Capricorn1)Commented:
do a search in the web for hex editor program called xv132
0
rpaaepAuthor Commented:
I have that one and found the value through looking at the hex editor at the file.

I was just wondering it there was a way to have the input function or some other function read up to the point of 0A.

What I am trying to do is automate this so it can simply be read, the record parsed and then loaded into a table.

0
Rey Obrero (Capricorn1)Commented:
0
rpaaepAuthor Commented:
What I noticed in the referred solution was a print command with the ";" at the end to not print the CRLF,

When I tried it with the Input command it gave a compiler error.

Any other ideas?
0
rpaaepAuthor Commented:
It was accurate for what was said.  What it did was put me in the right direction.  I ended up opening it as binary and then read a character at a time and checked for Chr$(10) for end of record.  That fully took care of the problem.

Thank you to cparicorn1.

Robert
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.