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 6 22609
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>
Trevor Fairchild <MR*******@e-crime.on.ca> schreef in berichtnieuws f5************* *************@p osting.google.c om... 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(MyValu e)" with "(not seek(MyValue) < lof(MyValue))"
That should be all ...
Regards,
Rudy Wieser
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.x s4all.nl>... Trevor Fairchild <MR*******@e-crime.on.ca> schreef in berichtnieuws f5************* *************@p osting.google.c om... 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(MyValu e)" with "(not seek(MyValue) < lof(MyValue))"
That should be all ...
Regards, Rudy Wieser
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.
> 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! =-----
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 ();
|
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 uninitialized value in concatenation (.) at register.pl line
38, <STDIN> line 10."
The PERL code is as follows:
|
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 the '' in the regExp
object, but 'Neil' is matched even though it is next to(?) the start of line
char(?) or should I say 'Neil' is the first 'word' of the string?
here's the code
<html>
|
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)
output = parameter(1)
Unforunately this method does not handle embedded spaces in the file paths,
for example C:\Documents and Settings\Administrator. Is there a simple way
to handle this? From my command prompt experience I know that paths...
|
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 could tell me
the key C# classes to use.
Thank you very much.
| |
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 compiled and I finally got my Inventory class compiled but when I run the program it prints the first line correctly then I input the item name but then it prints the next two lines when it should print one and allow me to input then print the next.
...
|
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 the file called admin.php
here is the code.
|
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 both the Project2.java and HouseGUI.java Here are the requirements for those two.
The GUI
Create a class called HouseGUI which extends JFrame. It should display two text areas (JTextArea) in a grid layout (1 row, 2 columns). Your main program,...
|
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 can't seem to figure out how to do it one line at a time.
Here is what I'm trying to do: I want the user to be able to print the text file one line at a time by clicking a button to see the next line.
Example: If text_file1 first line is...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |