0

I need to make my batch file replace a setting in "config.ini" for example:

color = 1A 

how can I find and replace ONLY the 1A part instead of making another line.

1 Answer 1

2

Are you in Unix-like OS? if so, just use the sed command:

sed 's/1A/replacedstring/' config.ini 

For more information: http://en.wikipedia.org/wiki/Sed

Sign up to request clarification or add additional context in comments.

2 Comments

added the third slash :)
Would had added -i to sed, but edit was to short ;) @user1941370: Be careful with sed and pipes for the write-back. Either use temp-files or sed -i

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.