|
|
#1 |
|
Addicted Member
Join Date: Sep 04
Location: Manchester
Posts: 206
![]() |
Reading from an awkward file...Thanks
Hello,
Any help is appreciated, I wish to read from a data file called persist.data and then read the ENTIRE file into one variable. Is this possible? The file contents will also be this only with different numbers. Code:
<?xml version="1.0" encoding="UTF-8"?> <root> <server> <stats> <total> 559 </total> <error> 16 </error> <html> 197 </html> <image> 362 </image> <notmodified> 149 </notmodified> <bytes> 3043332 </bytes> <uptime> 5154 </uptime> <since> Wed, 15 Jun 2005 14:05:31 GMT </since> </stats> <host> <id> 1 </id> <stats> <total> 559 </total> <error> 16 </error> <html> 197 </html> <image> 362 </image> <notmodified> 149 </notmodified> <bytes> 3043332 </bytes> <uptime> 5154 </uptime> <since> Wed, 15 Jun 2005 14:05:31 GMT </since> </stats> </host> </server> </root> Could all of this data fit into one variable? If not, how would I got about split it into an array using the Input command. Regards, Jord |
|
|
|
|
|
#2 |
|
Re: Reading from an awkward file...Thanks
Do you know anything about the XML DOM?
__________________
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Please go to the Thread Tools menu and click Mark Thread Resolved when you have your answer. If someone helped you today then please consider rating their post.
|
|
|
|
|
|
|
#3 | |
|
Addicted Member
Join Date: Sep 04
Location: Manchester
Posts: 206
![]() |
Re: Reading from an awkward file...Thanks
Quote:
|
|
|
|
|
|
|
#4 |
|
Re: Reading from an awkward file...Thanks
Then what you want to do is to download MSXML4 from Microsoft and install it. You may already have MSXML2 or 3 on your PC and they will work but 4 is better. Then using commands like selectNodes you will be able to get at the data you need. There are a lot of examples in this forum and the XML forum that should help you, and/or you can ask questions once you get started.
__________________
Tips, Examples & Tutorials: A valuable forum tool • Generate unique TreeView keys • TreeView with "open" and "closed folder" icons • Time code using GetTickCount • How to trap the Tab key • Scroll a form • NumberBox ActiveX control • Color a ListView row • An InputBox form • How to use SaveSetting and GetSetting • A program registration scheme • Spellcheck a Textbox • Resize controls • Open Windows Explorer at Last Visited Path • A Blackjack Game • Count lines of code • Please go to the Thread Tools menu and click Mark Thread Resolved when you have your answer. If someone helped you today then please consider rating their post.
|
|
|
|
|
|
|
#5 |
|
Old Member
Join Date: Nov 04
Location: In Hiding.... Weather: sizzzzlin'........ Code: Secret
Posts: 2,701
![]() ![]() ![]() ![]() ![]() |
Re: Reading from an awkward file...Thanks
to read it into one variable
VB Code:
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|