dexter23 Posted June 19, 2008 Posted June 19, 2008 Hi, I have a big .reg file from which I want to delete all "\" and "," characters. How can I achieve this?
SadBunny Posted June 19, 2008 Posted June 19, 2008 StringReplace() Roses are FF0000, violets are 0000FF... All my base are belong to you.
rudi Posted June 19, 2008 Posted June 19, 2008 Hi. No clue what you wanna do with the resulting "invalid" REG file, but never mind #include <file.au3> #include <array.au3> Dim $RegArr $RegFile = "c:\temp\dummy.reg" _FileReadToArray($RegFile, $RegArr) _ArrayDisplay($RegArr, "Original Array") For $i = 1 To $RegArr[0] $RegArr[$i] = StringReplace($RegArr[$i], "\", "") $RegArr[$i] = StringReplace($RegArr[$i], ",", "") Next _ArrayDisplay($RegArr, "Array Processing Done") _FileWriteFromArray($RegFile, $RegArr,1) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
LongBowNZ Posted June 19, 2008 Posted June 19, 2008 Open with text editor Find/Replace "\" with "" Find/Replace "," with ""
SadBunny Posted June 19, 2008 Posted June 19, 2008 Open with text editorFind/Replace "\" with ""Find/Replace "," with ""That's way more work than writing a script if you have more than one file Roses are FF0000, violets are 0000FF... All my base are belong to you.
LongBowNZ Posted June 19, 2008 Posted June 19, 2008 (edited) That's way more work than writing a script if you have more than one file True but if he has only one file then there is no point writing a script.I have a big .reg file Edited June 19, 2008 by LongBowNZ
dexter23 Posted June 19, 2008 Author Posted June 19, 2008 Hi. No clue what you wanna do with the resulting "invalid" REG file, but never mind #include <file.au3> #include <array.au3> Dim $RegArr $RegFile = "c:\temp\dummy.reg" _FileReadToArray($RegFile, $RegArr) _ArrayDisplay($RegArr, "Original Array") For $i = 1 To $RegArr[0] $RegArr[$i] = StringReplace($RegArr[$i], "\", "") $RegArr[$i] = StringReplace($RegArr[$i], ",", "") Next _ArrayDisplay($RegArr, "Array Processing Done") _FileWriteFromArray($RegFile, $RegArr,1)oÝ÷ Ù j·lFçbþ«¨µâ0j{m¢·¦¢÷ªºjºZÚ®¢Ý=Ú«¨¶)è׫¶¬z)Úm«ø¥{Ê&©ÝDA4áÆ®¶sb6æ6ÇVFRfÇC¶fÆRæS2fwC°¢6æ6ÇVFRfÇC¶'&æS2fwC° ¤FÒb33cµ&Vt' ¢b33cµ&VtfÆRÒgV÷C¶3¢b3#·6WGFæw2ç&VrgV÷C°¥ôfÆU&VEFô'&b33cµ&VtfÆRÂb33cµ&Vt'" ¤f÷"b33c¶ÒFòb33cµ&Vt'%³Ð¢b33cµ&Vt'%²b33c¶ÒÒ7G&æu&WÆ6Rb33cµ&Vt'%²b33c¶ÒÂgV÷C²b3#²gV÷C²ÂgV÷C²gV÷C²¢b33cµ&Vt'%²b33c¶ÒÒ7G&æu&WÆ6Rb33cµ&Vt'%²b33c¶ÒÂgV÷C²ÂgV÷C²ÂgV÷C²gV÷C²¤æW@¥ôfÆUw&FTg&öÔ'&b33cµ&VtfÆRÂb33cµ&Vt'"à is enough for me. Thanks!
rudi Posted June 20, 2008 Posted June 20, 2008 I want to remove "," and "\" in order to use in a batch file with command REG ADDThis <code> is enough for me. Thanks!You're welcome. Instead of doing so much changes, try to make use of REGEDIT's silent switch:regedit.exe /s YourRegFile.REGYou also might want to directly use the registry write capabilities of autoit:RegWrite()Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
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