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

Menu - Read from *xls or *.txt and import

Status
Not open for further replies.

duc996

Technical User
Jan 29, 2004
5
DE
I come from Germany. My English is not unfortunately very good.

I have a list with numbers. The numbers stand in a Textdocument or in Excel among each other.
12600019
12600020
12600021
12600025
...
..
The list should become finish reading and should appear under a Menuepoint in the Menuebar as Pulldown-Menue.
From the list, I would like to select an element that is send as " transmit " then.

How can I realize that?
 
Here is a script that shows how to open and read a text file containing a list of strings you wish to read:

proc main
string sLine

if fopen 0 "data.txt" READ TEXT ;Open text file containing data
while not feof 0 ;While data remains in the file
fgets 0 sLine ;Get entry from file
if not nullstr sLine ;If entry is not blank

endif
endwhile
endif
fclose 0 ;Close data file
endproc

data.txt would be located in your ASPECT directory, so modify this value to point to the file you are interested in accessing.

If the data is in Excel, you can use this script from my site to read the data into Procomm (this sample currently reads columns 1 and 2 of the spreadsheet, so would need a little modification for your purpose):


Regarding the rest of your request, are you wanting Procomm to display a dialog of some sort that would contain the data read from the file, and when you select a particular entry it would send that value to the remote system?


aspect@aspectscripting.com
 
Hello Knob, thank you for your answer. I sent a Mail with two appendices to you as example. Unfortunately is not here in the forum possible.

with friendly greeting,
duc996.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top