Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Simple help from you pros out there.

Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
I am using visual studio 2010 express. I would like to search for text and replace it in a .cfg file.
Text reads as following:

windowed=False

Would like to replace it with:

windowed=True

And Visa Versa.

Very simple. Thanks.
 
◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
899
  1. Read the file into a string
  2. Split the lines according to linebreak (new line)
  3. Split every linebreak on the = sign as splitline.
  4. If the first part of the splitline array is equal to your variable file then set the 2nd index of the splitline to your value.
  5. Concatenate the line again with the = sign in middle
  6. Then write the line to the new config file
  7. Save the new config file

Good job you're done now you've created your application in less then 5 minutes!
 
Junior Spellweaver
Joined
Oct 27, 2008
Messages
165
Reaction score
89
Depending on the language you're using, to store configs use a HashMap(Dictionary for .Net languages, std::map for C++)
 
Back
Top