473,385 Members | 1,942 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,385 software developers and data experts.

Line Input Method

Hello, all.

I am writing a program that parses an html report (generated by
another program).

I use the Open "C:\...." for Input As myValue method to open
the html, and read through it line by line, using "Line Input
#myValue, myLine" to do so.

My problem is that there are, occasionally, unusual Unicode characters
in the report. When the Line Input method hits a line with one of
these square-looking characters, it interprets it as an End-Of-File
marker. There is more information after it but VB refuses to access
it.

I cannot force another Line Input, and cannot even have a Mid()
function read any of the characters beyond this unicode character.

Does anyone have any ideas/suggestions on what command I can use to
trap this type of event? I was thinking I could use FileLen() to
identify how large the file is, and then compare it against a running
tally of the size of each line and say that, if fileLen >
runningTally, force past the current character.

Any help would be appreciated.

Trevor Fairchild
Jul 17 '05 #1
6 22595
Binary input

On 23 Dec 2003 08:14:28 -0800, MR*******@e-crime.on.ca (Trevor
Fairchild) wrote:
Hello, all.

I am writing a program that parses an html report (generated by
another program).

I use the Open "C:\...." for Input As myValue method to open
the html, and read through it line by line, using "Line Input
#myValue, myLine" to do so.


<snip>
Jul 17 '05 #2
Trevor Fairchild <MR*******@e-crime.on.ca> schreef in berichtnieuws
f5**************************@posting.google.com...
Hello, all.
Hello Trevor,
I am writing a program that parses an html report
(generated by another program).

I use the Open "C:\...." for Input As myValue method
to open the html, and read through it line by line, using "Line
Input #myValue, myLine" to do so.

My problem is that there are, occasionally, unusual Unicode
characters in the report. When the Line Input method hits a
line with one of these square-looking characters, it interprets
it as an End-Of-File marker.
That would be highly unusual ... The *only* character that's interpreted as
an EOF is CTRL-Z.
There is more information after it but VB refuses to access it.

I cannot force another Line Input, and cannot even have
a Mid() function read any of the characters beyond this
unicode character.

Does anyone have any ideas/suggestions on what command
I can use to trap this type of event? I was thinking I could
use FileLen() to identify how large the file is, and then
compare it against a running tally of the size of each line and
say that, if fileLen > runningTally, force past the current
character.


... which is half of what you are supposed to do :-)

1) Open the file "for binary: instead of "for input"
2) Replace the "eof(MyValue)" with "(not seek(MyValue) < lof(MyValue))"

That should be all ...

Regards,
Rudy Wieser

Jul 17 '05 #3
I had tried the binary on this issue and it didn't work - each time I
try to read the line, it only comes back with a portion of it...
I can't get into too much detail, but the program that makes this
report goes through a harddrive and rebuilds folder structures from
Unallocated Clusters - because these are folders that had been deleted
and now rebuilt, they are not always intact, and, as such, non-ascii
characters appear where the folder name cannot be 100% reconstructed.
I have put a sample of the character issue:

partsᨀ\00000001.did<br>

it is the square, after parts that is the problem.

When I use the Binary method, myLine only reads as "˙ūp" - I don't
know where the two other characters come from...
If I use the Input method, myLine comes out as "˙ūparts"

I can't even get VB6 to read that square - if I could, then I could
have it ignore it, or something...

"R.Wieser" <rw***************@xs4all.nl> wrote in message news:<3f*********************@dreader5.news.xs4all .nl>...
Trevor Fairchild <MR*******@e-crime.on.ca> schreef in berichtnieuws
f5**************************@posting.google.com...
Hello, all.


Hello Trevor,
I am writing a program that parses an html report
(generated by another program).

I use the Open "C:\...." for Input As myValue method
to open the html, and read through it line by line, using "Line
Input #myValue, myLine" to do so.

My problem is that there are, occasionally, unusual Unicode
characters in the report. When the Line Input method hits a
line with one of these square-looking characters, it interprets
it as an End-Of-File marker.


That would be highly unusual ... The *only* character that's interpreted as
an EOF is CTRL-Z.
There is more information after it but VB refuses to access it.

I cannot force another Line Input, and cannot even have
a Mid() function read any of the characters beyond this
unicode character.

Does anyone have any ideas/suggestions on what command
I can use to trap this type of event? I was thinking I could
use FileLen() to identify how large the file is, and then
compare it against a running tally of the size of each line and
say that, if fileLen > runningTally, force past the current
character.


... which is half of what you are supposed to do :-)

1) Open the file "for binary: instead of "for input"
2) Replace the "eof(MyValue)" with "(not seek(MyValue) < lof(MyValue))"

That should be all ...

Regards,
Rudy Wieser

Jul 17 '05 #4
even as I look at my message post, I see the square has been replaced
with



lol, you'll hve to trust me, though, it looks like a square on my
side, and even in my message - I guess Google groups, or Internet
Explorer changed it after I submitted it - it was a square.
Jul 17 '05 #5
> I had tried the binary on this issue and it didn't work - each time I
try to read the line, it only comes back with a portion of it...


In binary mode you get all the data, no lines. You have to parse
the data manually to break it up in any meaningful way. If you're
lucky, you might get End Of Line characters to help you, but don't
count on it.

Data in any file, is simple data, why didn't binary access work for
you?

LFS


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #6
On 24 Dec 2003 07:10:01 -0800, MR*******@e-crime.on.ca (Trevor
Fairchild) wrote:
even as I look at my message post, I see the square has been replaced
with



lol, you'll hve to trust me, though, it looks like a square on my
side, and even in my message - I guess Google groups, or Internet
Explorer changed it after I submitted it - it was a square.

Unicode is not really supported on the Web
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: josh dismukes | last post by:
/// here is the code i'm getting a parse error on the last line of the code which /// is </html> any help will be much appreciated. <?php session_start ();
1
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
1
by: Neil Morris | last post by:
Hi I have the following code that lists first names of people who's surnames are 'Morris'. What I am trying to do is search for first names that don't start at the beginning of the line ie. have...
7
by: David A. Osborn | last post by:
I am current writing a console program that takes two file paths as command line input. I get the command line input using the following code: parameter = Split(Command()) input = parameter(0)...
3
by: Beorne | last post by:
Hello, I have to ralize a graph with a pair of straight vertical lines that have to be dragged in the left-right direction with the mouse. I've never done something similar so I wonder if someone...
3
trkrbabe
by: trkrbabe | last post by:
Hi, this is my first time posting here. It appears that I am taking the same class as a few other people here. I have only been learning Java for about five weeks now. I have my Product class...
10
by: Faisal Shah | last post by:
HI, Well, Here is the code of my new project .. Actually it's just s scrap or it.. I have made 2 files. the 1st file is test.php with of course creating a new file called testdb.txt. And...
4
by: lilyumestar | last post by:
I have project I have to do for class. We have to write 4 different .java files. Project2.java HouseGUI.java House.java HouseSorting.java I already finish House.java and I need to work on...
11
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.