Basti756 Posted October 28, 2007 Posted October 28, 2007 Hi,I need help with finding and replacing a string. I wanna do the following: - Read data from a combo- search for that string in an ini file- replace the string in the ini file with something (i.e. 5)That's what the ini file looks like:[name] 1=givenname7 lastname9 2=givenname5 lastname3 . . .So let's say there's "givenname5 lastname3" written in the combo box. I want the script to find the string in the ini file and replace the value (and ONLY the value ) with "5". How am I doing this? This can't be so difficult, but I'm running out of ideas...Bastian
Achilles Posted October 28, 2007 Posted October 28, 2007 (edited) Look at $text = GuictrlRead($combo) <-- The data in the combo (called $combo) is stored (as $text) $iniData = IniReadSection($location, 'name') <-- $iniData is now an array with all the data from the 'name' section $temp = StringReplace('Hi how are you', 'are', 'aren't) <-- temp now equals 'Hi how aren't you' All those can be found with loads more detail in the helpfile. EDIT: Forgot IniWrite() EDIT2: But it looks like Nahuel got that one covered Edited October 28, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now