473,671 Members | 2,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to read data from html file using vb6.0

chandru8
145 New Member
Hi to all

Can any one explain me to read data from an html file.
iam have written the code to read an html file using file system object,
but it reading the source code.

thanks to all
May 26 '08 #1
10 13907
kadghar
1,295 Recognized Expert Top Contributor
Hi to all

Can any one explain me to read data from an html file.
iam have written the code to read an html file using file system object,
but it reading the source code.

thanks to all
just open it as a text file, it depends on the version, but OPEN/FOR/AS would be of help in older ones. (vba or vb6 for example)
May 26 '08 #2
chandru8
145 New Member
thnks for your reply can give any example

my code reading with tags
May 27 '08 #3
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Yes, When you open any HTML file, it does read with all the Tags..
You need to parse the String and remove tags and get appropriate info..
You have to code for it..

Regards
Veena
May 27 '08 #4
!NoItAll
297 Contributor
You do realize that you are not "reading data" but doing something called "screen scraping" instead.
HTML is a "display structure" not a "data structure." XML is a data structure. For example XML can tell you that the information between two tags is a monetary value, where HTML can tell you that it is only bold and blue. People tend to leave data structures alone, but display structures will change whimsically.
Ok - that said people still do what you are trying to do all the time.
Look at the Instr function in VB. Since HTML is not case sensitive make sure you make your Instr search case insensitive.

Des
May 27 '08 #5
chandru8
145 New Member
thanks kadghar for your reply
So can we use xml to read data from html,is it possible and how perfect it will be ,can you explain me little more in detail.
May 28 '08 #6
jeffstl
432 Recognized Expert Contributor
thanks kadghar for your reply
So can we use xml to read data from html,is it possible and how perfect it will be ,can you explain me little more in detail.
XML is not used as a programming language (cannot be used to "read" something). XML is strictly a transfer\storag e syntax. In other words it really is a portable database file. Nothing more. It holds data, and describes it.

If you want to read a HTML file as text you need to use the VB6.0 FIle System Object and then use the string selection functions in VB to extract the specifics you want.
May 28 '08 #7
kadghar
1,295 Recognized Expert Top Contributor
thanks kadghar for your reply
So can we use xml to read data from html,is it possible and how perfect it will be ,can you explain me little more in detail.
well, sure, it wont be that easy, but it can be done,

for example
lets say you have a Table, i dont remember the exact tags, but lets asume <Table> </Table> start and close the table, that <row></row> start and close a row, and <col></col> start and ends a column, and your data is written like:
<table>
<row><col>a1</col><col>a2</col></row>
<row><col>b1</col><col>b2</col></row>
<row><col>c1</col><col>c2</col></row>
</table>

so it looks like:

a1 a2
b1 b2
c1 c2

if your HTML code is in a string (lets say Str1)
then INSTR(str1,"<ta ble>") will return a Long, with the starting possition (lets call it Dou1)
INSTR(Dou1, Str1, "</table>") will give us the ending possition (say Dou2)
using MID from Dou1 to Dou2 will give you the code for where your data is.
using SPLIT a couple of times will put this data into an array (actually an array of arrays, but its not big deal)

HTH

Kad

Note: i forgot, i think split only works with characters as delimiters, so you might have to use REPLACE to change the tags with some delimiter of your choice.
May 29 '08 #8
perhapscwk
123 New Member
oh..reading source code..that what I was looking for?

could you post your code for my reference?

thanks.

Hi to all

Can any one explain me to read data from an html file.
iam have written the code to read an html file using file system object,
but it reading the source code.

thanks to all
May 30 '08 #9
mehars
1 New Member
Dear All,

I need your help to read and convert data from HTML files to MS SQL Server.
Data in HTML is stored in form of tables.

Someone please write a piece of code to open and Read tabular data in HTML.

Thanks
Jun 15 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
8994
by: Gunnar | last post by:
Hello, I've just written a CPP program that reads integers from a binary file, and used this code while (my_ifstram.read( (char* ) &number, sizeof(int)) { // do something with number } My question is now, where can I find a manual that describes what the read method does with the ifstream object? I'm sitting here with my Linux/Debian machine, but I have not found any
2
3289
by: Reply Via Newsgroup | last post by:
Folks, I'm pretty sure it can be done, and I'm doing pretty good with my javascript so I'm pretty sure I just need a quick point in the right direction... If my web page is referenced in the address bar, how can I read these arguements? Thus, with
18
4878
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
1
4298
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each time after routine process A, the text file is named "mytext.dat" in following format with "#####" as separator. The maximum entries of them is 5. When reaching the fifth entry, it will delete the very first entry.
16
3486
by: ben beroukhim | last post by:
I have huge number of legacy code which use standard files functions. I would like to pass a memory pointer rather than a FILE pointer. I am trying to use FILEs in the code to refer to memory buffers. Basically, I want to be able to use all the standard read and write functions, but I want them to refer to memory locations, rather than disk files. I do not want to touch the legacy code. Does any one know of a library
10
2532
by: Tibby | last post by:
I need to read/write not only text files, but binary as well. It seems like on binary files, it doesn't right the last 10% of the file. -- Thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003
6
9681
by: Karthik | last post by:
I am trying to read Http request body values NOT form values The content type is text/xml and its POST I am posting data from Infopath to an asp.net page. In ASP it works by just writing Response.Write(request) the same does not work in ASP.NET I tried using Rquest.BinaryrRead() and Request.InputStream but it gives me text values as space separated (eg Karthik yyyy aaaa) whereas the data i am looking out for is in XML format.
14
5758
by: Zoro | last post by:
My task is to read html files from disk and save them onto SQL Server database field. I have created an nvarchar(max) field to hold them. The problem is that some characters, particularly html entities, and French/German special characters are lost and/or replaced by a question mark. This is really frustrating. I have tried using StreamReader with ALL the encodings available and none work correctly. Each encoding handles some characters...
3
6241
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" ...
3
5391
by: sejal17 | last post by:
hello Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store that multiple worksheet data in different table.How can i do it.Below is my xml file. <?xml version="1.0"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office"...
0
8483
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8927
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8676
tracyyun
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...
0
7445
agi2029
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...
0
5703
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();...
0
4227
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...
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2062
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.