473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Diffficulty w/ EOF character

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
2 3953
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Safalra | last post by:
The idea here is relatively simple: a java program (I'm using JDK1.4 if that makes a difference) that loads an HTML file, removes invalid characters (or replaces them in the case of common ones...
37
by: chandy | last post by:
Hi, I have an Html document that declares that it uses the utf-8 character set. As this document is editable via a web interface I need to make sure than high-ascii characters that may be...
4
by: mimmo | last post by:
Hi! I should convert the accented letters of a string in the correspondent letters not accented. But when I compile with -Wall it give me: warning: multi-character character constant Do the...
7
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %%...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
15
by: wizardyhnr | last post by:
i want to try ANSI C99's unicode fuctions. so i write a test program. the function is simple, but i cannot compile it with dev c++ 4.9.9.2 under windows xp sp2, since the compiler always think that...
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
10
by: Paul W | last post by:
Hi all, I have an application that reads data in from a text file and stores it in a database. My problem is that there are some characters in the file that aren't being handled properly. For...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.