|
-
Apr 28th, 2006, 06:02 PM
#1
Thread Starter
Lively Member
[RESOLVED] Parsing from text file to mainfraim application
Hi guys, just found this forum this morning & have spent the whole day reading through the wealth of knowledge you've all created here. I was hoping somebody might be able to help me with a project I'm working on...
I need to write a program that will pull data from a text file & put it into a mainframe client session. In the past, everything similar that I've written pulls from excel, which (to me anyway) is nice & simple. I just define my spreadsheet as an object, define my cell as an object, Define X as my start row to end row on the spreadsheet and then use codes like this:
TEXT = objWorkBook.Sheet1.Cells(X, 4).Value
Sess0.Screen.Sendkeys (TEXT)
That works great when my raw data comes from excel, but my current project is to write a similar macro that parses a text file instead of a spreadsheet. Below is an example of the text I need to pull from:
INTERNET CENTER:
COMPANY NAME: Fakecompany Inc
STREET ADDRESS 1: 123 Main St.
STREET ADDRESS 2:
PROV/MUNI:
CITY, STATE, ZIP: Amityville, VA, 20151-
I know there is a way for me to have it look for the "COMPANY NAME:" label & then set the rest of that line as a variable for me to send to my session...but I have no clue how to do it. How do I make the text file an object? How do I get the code to pull the right data out of the text? After reading through about 8,000,000 posts on here and all the helpfiles I can find...about all I've managed to do is get my code to open the text file in notepad by using this line:
'defines "ORD" as the order # typed into the dialog box that begins the program.
ORD = dmain.textbox1
'opens the requested order
Shell "notepad.exe " & "C:\my folder\" + ORD + ".txt"
Isn't there a code that lets me just basically do the following (this isn't real code, this is just what I want to do)
COMP_NAME = (text after "COMPANY NAME:" until end of row)
Sess0.Screen.Sendkeys(COMP_NAME"<ENTER>")
Last edited by Bill-E-BoB; May 2nd, 2006 at 12:27 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|