Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flat ASCII File input

Status
Not open for further replies.

rnissel

MIS
Nov 27, 1999
1
US
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.
 
There are other methods of reading a ASCII file...<br>
<br>
Look into: "Line Input" that grabs one line at a time.<br>
<br>
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).<br>
<br>
Good Luck<br>
Pete<br>
PeteS@Bradfordsys.com
 
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.<br>

 
It is also possible that the &quot;spaces&quot; are the tab character. <br>
<br>
If you do not have a hex editor, use debug.<br>
At the DOS prompt enter:<br>
debug textfile.xxx (whatever your filename is) and then press enter.<br>
<br>
then type in &quot;d&quot; 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.<br>
<br>
Enter &quot;q&quot; without the quotes and press enter to exit debug.<br>
<br>
Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top