Repost: Removing EOF char from txt file 
Author Message
 Repost: Removing EOF char from txt file

Sorry, I had to correct my previous post as follows:

I need to delete an "EOF" character in the beginning of a text file I'm
using for input.  Here is the string that it gets stuck after (in
quotes):  

"D? ?"

How can I delete this character or just get past it?  Visual Basic sees
one of these characters as an "end of line" character and will not let
me proceed with any further Line Inputs.

*** Sent via Developersdex http://www.*-*-*.com/ ***
Don't just participate in USENET...get rewarded for it!

  _alt.0
1K Download


Wed, 25 May 2005 00:21:32 GMT  
 Repost: Removing EOF char from txt file

Well in C++ when I had this problem I used a function that does the following:
----------
Open file for input one character at a time
  do
    Read one character from the file
    If integer value of character = -1
      Discard char and exit loop
    else
      Do something with that character such as put into a buffer
    end if
  loop
close file
---------

I am not sure if that would translate well into VB, but I would imagine something like:
========
boolContinue = true
iLoop = 0

Open "file.txt" for input as #1
Do while boolContinue = true
  myChar = Input (1,#1)
  if myChar = -1 then
    boolContinue = false
  else
    buffer(iLoop) = myChar
  end if
loop
buffer(iLoop) = EOF // in C++ EOF = '\0' not sure what it is in VB
close #1
========

-Russ


  Sorry, I had to correct my previous post as follows:

  I need to delete an "EOF" character in the beginning of a text file I'm
  using for input.  Here is the string that it gets stuck after (in
  quotes):  

  "D? ?"

  How can I delete this character or just get past it?  Visual Basic sees
  one of these characters as an "end of line" character and will not let
  me proceed with any further Line Inputs.

  *** Sent via Developersdex http://www.developersdex.com ***
  Don't just participate in USENET...get rewarded for it!



Sat, 28 May 2005 16:47:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Removing EOF char from txt file

2. REPOST: Want mask chars but not prompt chars in MaskEdBox (from Aug 22)

3. .txt Files Used Directly In CR 8.5? - Repost

4. Help Removing Lines From TXT Files.

5. remove rtf encoding from txt files

6. Help: How to remove duplicate value llines from txt file

7. MSCOMM EOF Char

8. Adding .TXT files to a VB program without the .TXT file

9. Reading a text file char by char.

10. How to remove "|" (pipe char) from txt file

11. Char by Char file input?

12. delete chars in txt's

 

 
Powered by phpBB® Forum Software