unflinching idealism ... since 1997 archivessitemapabouthelpfeedback
where paths intersect
  • Home
  • InFocus
  • Themes
  • Columns
  • Articles
  • Fiction
  • iLogs
  • Gallery
  • Unplugged
  • Writers
  • Interactors
  • Tags
Sign in | Join Chowk
web chowk
« November 2009 »
SMTWTFS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30

Recently by einsteinwallah

  • 2009-04-03 Picks
  • 2009-04-02 Picks (and No Its Not Working)
  • 2009-04-01 Picks
  • 2009-03-31 Buy Prices etc
  • Picks for 2009-03-31 For My Paper Trading Account
  • 2009-03-30 EOD
  • 2009-03-30 Today's Buy Prices
  • 30/03/2009
  • Friday 2009-03-27 EOD revised
  • 27/03/2009 Positions taken
  • March 27, 2009, 6:06:38 AM
  • 3:01 PM 26/03/2009
  • 8:30 AM 26/03/2009
  • 20090326
  • Processing HTML Data File Using QBasic
  • It is 5:16 AM 25/03/2009

iLog Categories

  • All
  • Personal
  • Fiction
  • Poetry
  • Travel
  • Work
  • Sports
  • Books
  • Movies
  • Music
  • Philosophy
  • Politics
  • Humor
  • Religion
  • Chowk
  • Other
  • einsteinwallah
  • Intro & Favorites
  • iLogs
  • Gallery
  • Interacts

Processing HTML Data File Using QBasic

Posted: Mar 25, 2009 Wed 11:23 am     Views: 260   

If you go to http://ukmarkets.rbs.com//EN/Showpage.aspx?pageID=5 and restrict list of RBS products to Stock and change "Number of results" to 200 the webpage shows all Stock based warrants issued by RBS. When you save this list to DATA.HTM you get a file which has lines which are huge. What webpage has saved is html in which there are no "end-of-line" at one spot and processing this file to extract data for our number crunching is going to be tough if we can not read lines. At the troublsome spot QBasic runs out of memory for string space when you try to execute QBasic command: LINE INPUT on file. This is a work around to break up long lines into bite sized lines.

First you need to download olddos.exe file from microsoft website from link given below. Be aware that older MS-DOS files may not work with newer operating systems.

http://download.microsoft.com/download/win95upg/tool_s/1.0/w95/en-us/olddos. exe

Following QBasic SUB subroutine program takes DATA.HTM as input file and creates another file called LEXICAL.TXT. In this second file an "end-of-line" is inserted after each > character.

SUB Lexical
DIM InChar AS STRING
DataFile = FREEFILE
OPEN "DATA.HTM" FOR BINARY ACCESS READ WRITE AS #DataFile
LexicalFile = FREEFILE
OPEN "LEXICAL.TXT" FOR OUTPUT AS #LexicalFile
FileLength = LOF(DataFile)
InChar = " "
FOR i = 1 TO FileLength
GET #DataFile, i, InChar
PRINT #LexicalFile, InChar;
IF InChar = ">" THEN PRINT #LexicalFile,
NEXT i
CLOSE #DataFile, #LexicalFile
END SUB


+ add to my favorite ilogs + flag objectionable content



einsteinwallah

  • Interacts: 373
  • iLogs: 56
  • Gallery: 3
  • Page views: 10489
  • Last visitor: guest
  • Member since: Sep 16 2002
  • Last signin: Oct 2 2009
  • Send a message
  • Add as friend
  • Add to ignore list
  • Add to block list

Favorite iLogs

  • MURAWWAT O MOHABBAT KE MABAIN (afsana)
  • My MUSIC PAGE
  • Small Things That Make A Big Difference
  • The Cup of Coffee............... an interesting article tht i came across
  • Hatred Than Love

Top 5 Articles This Week

  • Popular
  • The MF Husain Controversy: Identity, Intent and the Rise of Militant Fascism
  • Vision21: Waziristan Strategy or Pakistan Strategy?
  • When Will You Return?
  • India's Primary Duty
  • Defeating the Taliban in Pakistan
  • Featured
  • There are a Lot of Monkeys
  • White Charade
  • Words of a Woman
  • FOX News and the Smelly Shoes
  • Dilemmas of Creative Children
  • 10 Years Ago
  • Water of Life
  • Autobiography of a Forgotten Indian
  • Information Revolution - Utopia or Bust?
  • The Leasing Sector in Pakistan and its Role in Capital Investment
  • Perchance to Dream

Write on Chowk Interact Guidelines Privacy policy Terms Contact

Copyright © 1997 - 2009 chowk.com. All Rights Reserved
Reproduction of material on any www.chowk.com pages without prior written permissions is strictly prohibited