Remove EOF markers from text file

Posted on 2003-02-22
Medium Priority
Last Modified: 2012-05-04
I am working with a text dump from a legacy system.  Te output file is loaded with EOF markers.  I keep getting a error 62.  Any suggestions?
Question by:Dagor
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 18

Expert Comment

ID: 8000731
not sure if this would work:
Dim ff as integer
ff = freefile
Dim strText as string
open "C:\my documents\test.txt" for input as #ff
strText = Input (LOF(ff), #ff)
strText = Replace(strText, "<EOF char, which i don't know off hand>", "<another char>")

Author Comment

ID: 8000893
Already tried that, it gives the can't read passed EOF err.62 before you can get to the point to replace it.

Accepted Solution

Frog357 earned 150 total points
ID: 8001353
You can work around this by opening the file in Binary access mode, for example:

Open sFile For Binary As nfile
txtopen = Input(LOF(nfile), nfile)
Close nfile

Then if you still need to remove the chr, I am very certian it's Chr(0).

Author Comment

ID: 8001797
still get the following

Run-Time Error '62'

Input past end of file  

Example of file:


Author Comment

ID: 8001829
Have to take that back, I still had the file for input rather than binary.....

Frog357's answer worked

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question