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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a text file from incoming data from host 1

Status
Not open for further replies.

bursland

Technical User
Mar 21, 2005
14
0
0
GB
I have programmed a fair number of macro's but i am stuck with this problem.I need to cature data from the host into a text file for manipulation in a VB app.However this data is fairly unstructured and varies in length from a couple of screens in length to sometimes 20 screens.I have tried a number of different methods but most fail completely or seem to miss parts of the data .Anny help would be appreciated
 
In order to only address your actual problem, let me pose a few questions.

Are you having trouble grabbing the data or writing to the file?

Does the screen scroll automatically, or is a keystroke required?

Have you used arrays in the past?
Are you using VB to pilot EB?

calculus
 
Calculus,

Thanks for your reply here are the answers to your questions.
The data scrolls automatically ,there is header information which I have tried triggering to, to frezee screen with <ctrl s> read the screen then continue
<ctrl q> until the next header.This worked but the rows between the headers are 1> the display so every screen grab was losing 1 line of text.I am familiar with arrays having used them in visual basic which is my usual programming language .I intend to use EB if possible to run this macro then shell into VB to run the analysing program .Or if it is simpler I could use VB to do the whole program.

Thanks again for your time
 
I'd use VB to do the whole program. Add a reference to attachmate, then here are the objects I use:

Public System As ExtraSystem
Public Sessions As ExtraSessions
Public Sess0 As ExtraSession
Public MyScn As ExtraScreen

Set System = New ExtraSystem
Set Sessions = System.Sessions
Set Sess0 = System.ActiveSession
Set MyScn = Sess0.Screen

Now you can refer to MyScn with a drop down box in VB. This will also show you some things in the EB objects that you may have been unaware of.

I've never coded with a scrolling screen, but I've helped with some post in the past. There was some success using the search object.

Dim WarSearch As Object
Set WarSearch = MyScn.Search(SearchText)

Now the object has a top, bottom, left and right.

You could also use the area functions to capture the screen, then use some text functions to get the data out.

The reason I suggested arrays is that you can grab the data and store it in an array, then pull it back later.

Good luck,

calculus



 
Calculus,
Thanx for the tips .When I return to the office tomorrow I will give the code a try.

Regards

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top