Jump to content

Delete some characters from .reg file


Recommended Posts

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!

Link to comment
Share on other sites

Open with text editor

Find/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.

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

I want to remove "," and "\" in order to use in a batch file with command REG ADD

This <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.REG

You 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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...