Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Flat ASCII File input

Flat ASCII File input

Flat ASCII File input

I need some help on a Flat File read. I have inputed this file as a string of 160 bytes and also byte by byte until I hit a CR/LF. When I get over 120 chars I lose the space chrs from the file. sometimes it works but most of the time it does not. All of the spaces, chrs$(32), are missed and this messes up the file. Any help would be great.

RE: Flat ASCII File input

There are other methods of reading a ASCII file...

Look into: "Line Input" that grabs one line at a time.

Another way... might be to use a collection and store each line in the collection and the going from there (this will preserve the main file from getting corrupted).

Good Luck

RE: Flat ASCII File input

Before trying anything else I would suggest looking at the data file in a hex editor/viewer. Are you sure those spaces are actually Chr$(32)'s? They may be NULLs or even Chr$(255)'s.

RE: Flat ASCII File input

It is also possible that the "spaces" are the tab character.

If you do not have a hex editor, use debug.
At the DOS prompt enter:
debug textfile.xxx (whatever your filename is) and then press enter.

then type in "d" without the quotes and press enter. This will (d)ump a number of bytes to the screen. You will see both text representation and the hex value. This will show you if there are really spaces or some other character in your text file.

Enter "q" without the quotes and press enter to exit debug.

Good luck

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close