Question:

How can I Modify Variables inside a txt file?

by  |  earlier

0 LIKES UnLike

Im looking for a way to change variables inside a text file? for instance I have a Install.iss file. Inside the ISS file is a variable I put in called %COMPNAME% and another called %WORKGROUP%. Is there a way to run a program or script against this file and read the system variables and do a search replace? I also want to use this on several other text files. Thanks.

 Tags:

   Report

2 ANSWERS


  1. "sed" is what you are looking for. It is included in almost every unix/linux dists or you can download it:

    http://gnuwin32.sourceforge.net/packages...

    ---

    Download the setup package: it shoud work on windows xp.


  2. I would use Apache's ANT tool to make this happen.

    Creating ANT build files is similar to a script of another kind, except it is build using XML and pre-defined tag sets. They have a standard function for finding and replacing values within text files. Check out the Replace task.

    It's a very powerful tool once you learn everything it can do.  

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.