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!

script to send/read com port write to file

Status
Not open for further replies.

neauxhow

Technical User
Aug 22, 2014
1
US
hi,

I am new here but have been using procomm for some time. I have done simple scripts and have read through a lot of post but cant find anything to help me with what i need to do. I am trying to create a script to transmit a command to the comport, write some of the response plus a label to a file or capture. I am pulling configuration data from a piece of equipment and would like to write the data to a text file.

Example:
send <0/IPA?
returns >0000/IPA=010.209.203.003.24

i would like to write to a file:
IP address = 010.209.203.003/24

I have a lot of commands i will need to send and copy the response after the "=" to end of line and append it to a label then write to a file.

I have managed to open a capture with equipment name and date. write the IP address = to the file but i do not know how to manipulate the data coming back and only write the data after the "=".

Thanks in advance for and assistance.


 
You can use the rget command (actually usually multiple rget commands) to read data coming from the com port, but I usually find it easier to save the current screen to a text file using the snapshot command, then parse that file for the data that I'm looking for.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top