Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Remove EOF markers from text file

Posted on 2003-02-22
5
Medium Priority
?
985 Views
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?
0
Comment
Question by:Dagor
  • 3
5 Comments
 
LVL 18

Expert Comment

by:bobbit31
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>")
close(ff)
0
 

Author Comment

by:Dagor
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.
0
 
LVL 4

Accepted Solution

by:
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).
0
 

Author Comment

by:Dagor
ID: 8001797
still get the following

Run-Time Error '62'

Input past end of file  

Example of file:

V,HVPYOU1
     ,,U
W,HW00101
0
 

Author Comment

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

Frog357's answer worked
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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 Month12 days, 1 hour left to enroll

564 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