Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Extraction Code

4 views
Skip to first unread message

JoJo

unread,
Aug 24, 2009, 9:59:26 AM8/24/09
to
Folks:


I have an HTML file (see general structure below ) that is about 100 pages
long. Scattered throughout this document (in a really disorganized fashion)
are 6 or 7
categories or fields of information like: Name of article, Author of
Article, Date Published, Comment, Full Story, Printer version, etc. Some of
this information in
my document is in the form of HTML hyperlinks. I am attempting to extract
some of this information in such a way that the HTML links are preserved and
not
automatically transformed to pure text.

Specifically, I am interested in the DOS code that would extract the
following 2 pieces of information from my HTML document and create a
separate document:
(1) Names of the articles (always starts with ">>" followed by the
actual article name in the HTML format
(11) Date published ( | Published 08/9/2009 | ) Note this information
is contained between the "|"

* I am interested in the DOS code to extract these 2 pieces of
information listed above.


--------------HTML file that is about 100 pages
long----------------------------------------

Articles by this Author - Page 1 (Page 1 of 100) � Back | 1
| 2 | 3 | 4 | 5 | Next �

>> Set A Goal For Trading Success
By James Johnson | Published 08/9/2009 |
Do you have a written goal of what you expect to make from your trading this
year?
full story printer version
............................................................................
................................................................
----------------------------------------------------------------------------
-----------------


Thanks,
Jon.


Tom Lavedas

unread,
Aug 24, 2009, 10:46:43 AM8/24/09
to

By 'DOS', I assume you mean at a Window's command prompt - not
literally with a version of DOS. It would be easier to do this with
Windows Scripting, but depending on the exact internal structure of
the page(s), a FIND or FINDSTR (maybe in conjunction with a FOR loop)
should be able to do this. However, regardless of the scripting
approach much more information about the structure of the HTML code is
required to be able to do this.

Specifically, the HTML tags that define the anchors are needed as well
as how many lines of text the information you desire occupy in the
HTML code (not how many are displayed in your browser). Maybe a
reasonable sample of the HTML text would be sufficient to get a
start. But, without that, there is hard to say where to start.

Tom Lavedas
***********

.

unread,
Aug 26, 2009, 2:30:08 AM8/26/09
to
Something like
findstr ">> |" Filename.ext
may do it if the sequence is related.

>>hithere
|link|
text
text
>>hithere1
|link1|
text
text

will result in

>>hithere
|link|
>>hithere1
|link1|
--
.
--
"JoJo" <swift...@comcast.net> wrote in message
news:OCmn9JMJ...@TK2MSFTNGP03.phx.gbl...

> Articles by this Author - Page 1 (Page 1 of 100) � Back |
> 1
> | 2 | 3 | 4 | 5 | Next �

0 new messages