Shyke Posted October 1, 2005 Share Posted October 1, 2005 Alright, here is another problem I have found that needs to be done and I have no idea about...In AutoIt how would I go through a giant ini file (4mb) and remove every line that says money=-1 ?Here is how some of the things look like:[creature 38]damage=2.628571 3.028571flags1=080000name=Defias Thugtype=7family=7level=4npcflags=00maxmana=0faction=17model=5035bounding_radius=0.208combat_reach=1.5attack=2000 2000loottemplate=38speed=0.92equipmodel=0 7487 2 7 1 13 3 0 0 0loot=752 34.8714money=-1I need to get that money thing out on a large scale.Can anyone help me? Link to comment Share on other sites More sharing options...
LxP Posted October 1, 2005 Share Posted October 1, 2005 Personally I would suggest just opening the file in the standard way and copying any line not matching 'money=-1' to a new file. You could then just replace the old file with the new one and the job's done. Something like this maybe (warning: no error checking implemented) -- local $path = "c:\file.ini" local $tempPath = @tempDir & "\tempFile.ini" local $file = fileOpen($path, 0) local $temp = fileOpen($tempPath, 2) while 1 local $data = fileReadLine($file) if @error then exitLoop if stringLower($data) <> "money=-1" then fileWriteLine($tempPath, $data) wEnd fileClose($file) fileClose($temp) fileDelete($path) fileMove($tempPath, $path) Link to comment Share on other sites More sharing options...
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