By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,337 Members | 2,084 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,337 IT Pros & Developers. It's quick & easy.

Diffficulty w/ EOF character

P: n/a
I have a bunch of text files I'm trying to parse. The files all have several
occurrences of chr(26), which is EOF (End Of File). Each file is ~ 1meg of
text, and every file is a real mess. The looks something like this:

Date=1/1/04-=time4:20pmSalesperson-=-)JIM HENDERSON$%L_#*(%-+*
da_FIRST.........------MIKE
da_LAST .........------TURCO
da_PRODUCT.....------BOAT
da_YY...........------04
)(#$%^&*

Date=1/1/04-=time4:20pmSalesperson-=-)JIM HENDERSON$%L_#*(%-+*--=
da_FIRST.........------JAMES
da_LAST .........------THAMES
da_PRODUCT.....------RV
da_YY...........------02
)(#$%^&*
Note that this is pseudo data (for simplicity) and also that I am using the
* character to represent the EOF character. Also, if I do a manual
search-and-replace for the EOF character, my code works perfectly. What is
happening, for sure, is that Access Basic is seeing the EOF character and
interpreting it as an actual end of file. Here is a code snippet:

Do While Not EOF(FileNo)
Input #FileNo, g$
Select Case left(g$, 4)
Case "da_F"
.AddNew
If Len(g$) > 53 Then
![RO CLOSE] = Right(g$, Len(g$) - 53)
End If
Case "da_L"
If Len(g$) > 53 Then
![RO-NUMBER] = Right(g$, Len(g$) - 53)
End If
So, the problem I have is how to either ignore or get rid of this EOF
character. I've tried Line Input, Input # and Input functions. In every
case, when I hit the EOF char, Access thinks it is the end of the file. If
you have any suggestions, I'd appreciate it.

Here's another issue, which I guess is a little OT because its a windows
problem, but it still relates to this database. Doing a search-and-replace
for this EOF character in notepad is (marginally) acceptable for now. On
some XP computers, using notepad, I see this EOF character as a right facing
arrow and its easy to find, search out and replace. On other computers,
control characters are displayed as a box. I don't think its a Unicode
problem because I'm able to see all of the higher characters on the screen.
Its just the lower (control) characters that display on some computers and
not on others. FWIW, I have tried different fonts on the different
computers. Both fixedsys and courier fonts display the character correctly
on my computer, but as boxes on other computers. Is there a control panel
setting somewhere, or something, that turns the display of control
characters on or off?

I'm using AccessXP.

Thanks!

Mike




Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Fri, 22 Oct 2004 12:54:00 -0700, Mike Turco wrote:
I have a bunch of text files I'm trying to parse. The files all have several
occurrences of chr(26), which is EOF (End Of File). Each file is ~ 1meg of


Hello Mike
I came across something equal time ago with SAP-Data:
Sometimes it came in wrong UNIX-Format.
Read the whole file in binary mode at once using Lof
Use an array to identifying Records by vbcrlf (maybe chr$(10))
After this has be done start DB-operations.

hth

Heiko Ulf
Nov 13 '05 #2

P: n/a
Sorry I can't help with the top portion, but you will find more success with
special characters and large files if you shred your Notepad and use a more
capable replacement like NoteTab. There is a free version available,
NoteTab Light, whcih should make your life easier:

http://www.notetab.com/
Darryl Kerkeslager
"Mike Turco" <mi*******@yahoo-nospam4me.com> wrote:
Here's another issue, which I guess is a little OT because its a windows
problem, but it still relates to this database. Doing a search-and-replace
for this EOF character in notepad is (marginally) acceptable for now. On
some XP computers, using notepad, I see this EOF character as a right facing arrow and its easy to find, search out and replace. On other computers,
control characters are displayed as a box. I don't think its a Unicode
problem because I'm able to see all of the higher characters on the screen. Its just the lower (control) characters that display on some computers and
not on others. FWIW, I have tried different fonts on the different
computers. Both fixedsys and courier fonts display the character correctly
on my computer, but as boxes on other computers. Is there a control panel
setting somewhere, or something, that turns the display of control
characters on or off?

I'm using AccessXP.

Thanks!

Mike



Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.