Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrape multiple lines in one go

Status
Not open for further replies.

jazznaura

Technical User
Jul 9, 2008
5
GB
hi all,

i have a quick question which i can't find the answer to. i use excel often to scrape info from extra and its either a few strings or a single line of info.

Recently i've had to scrape multiple lines (10-15 per page) on multiple pages (up to 300). my question is, is there a way of capturing multiple lines of a page.

thanks,

something like:

Print #1, MyScreen.area(8, 1, 22, 80)' get multiple rows


this is the kind of loop i use now.

Do
Do Until Z > 22
If Trim(MyScreen.area(Z, 1, Z, 80)) <> vbNullString Then Print #1, MyScreen.area(Z, 1, Z, 80)
Z = Z + 1
Loop
Z = 10

KeyW "<PF2>"' next screen

Loop Until MyScreen.area(24, 42, 24, 57) = "INQUIRY COMPLETE"


i'm hoping to speed up the capture of data, any help/advice would be great.

jazznaura
 


hi,

It is my preference. I scrape the entire screen, in my case a 3270 emulation of 24 x 80.
Code:
sDate = oScrn.Area(1,1,24,80).Value
then parse each row, using the MID() function.

Furthermore, I have built a screen map table that discribes the data on each row, like
[tt]
ScrNam FIELD FR TR CL LN TYP
AP412431 ScrName 1 1 3 8 CHAR
AP412431 ScrDesc 1 1 11 50 CHAR
AP412431 SysDte 1 1 61 8 CHAR
AP412431 SysTme 1 1 70 8 CHAR
AP412431 Page 2 2 75 4 NUM
AP412431 Part Number 3 3 17 16 CHAR
AP412431 Nomen 3 3 36 16 CHAR
AP412431 TRAVELER 7 19 3 7 CHAR
AP412431 Status 7 19 10 1 CHAR
AP412431 CNF 7 19 11 3 CHAR
AP412431 ActQty 7 19 15 5 NUM
AP412431 PC 7 19 21 2 CHAR
AP412431 LC 7 19 24 2 CHAR
AP412431 PlnINWK 7 19 27 4 NUM
AP412431 PlnCOMP 7 19 32 4 NUM
AP412431 MRP Need 7 19 37 4 NUM
AP412431 Type 7 19 43 1 CHAR
AP412431 C_OP 7 19 47 4 CHAR
AP412431 C_CC 7 19 52 3 CHAR
AP412431 C_LC 7 19 56 6 CHAR
AP412431 LstMov 7 19 63 4 NUM
AP412431 HldCds 7 19 68 5 CHAR
AP412431 QMS 7 19 74 1 CHAR
AP412431 NetGrp 7 19 76 4 CHAR
AP412431 MSG 22 22 2 78 CHAR
[/tt]
This table descrie everything I need to properly parse my sData string and assign the value to the proper data type.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
thanks skip for the reply,
i'll give this a go tomorrow, can I ask do you use this method because you found it to be the most efficient ? speed wise.
I also like the idea of the screen map, would be useful when coming back to a project to build addons.


 



I have ONE routine for scraping any screen, not one routine for each screen.

I can set up the data in a matter of a few minutes and be ready to roll. THAT is what is fast.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top