Kickboxr Posted September 10, 2005 Report Share Posted September 10, 2005 I am automating some processes which are spcific to each job. I was doing pretty well, but have not been able to replace variables with their value in a file. For example. I have a text file with commands for a router. in the text file are variables that will be specific to each router. Such as IP address = %T1%. I have some popups that ask questions storing those values as variables T1, T2, T3, etc. Once all the questions are answered I need to open the text file, and replace %T1% with the value stored for that variable and so on with T2, T3 etc. then save the file as temp1 for upload to the router. When the script begins it will find the file, delete the temp file if exists, clear all variables, and then begin the process. But I can not figure out how to get the values into the file. Does anyone have some assistance or examples of this? A brief example of the file is attached. file1example.txt Quote Link to comment Share on other sites More sharing options...
Kickboxr Posted September 10, 2005 Author Report Share Posted September 10, 2005 Let me elaborate a little more... I have a file like file 1 which is the template. That file reamains unchanged, and I need the macro to open the file, replace the variables, then save as temp1. That way my template is always untouched. Quote Link to comment Share on other sites More sharing options...
randallc Posted September 11, 2005 Report Share Posted September 11, 2005 Hi, Your file looks simple enough to use "Ini read/ ini write" if yoy change it to an ini file? Best, randall Examples; ini thread1 ini thread2 Quote Link to comment Share on other sites More sharing options...
Kickboxr Posted September 11, 2005 Author Report Share Posted September 11, 2005 Thank you, I will check that out and see how it works. I am currently hard coded it all as text, then paste it inot note pad and save. crude I guess, but it moved me forward. Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.