I have a variable called $sequence that I would like to find out how to output it with two positions in the file name on the filecopy line.
Thanks,
Docfxit
[ autoit ]
Dim $sequence = 00 ; $Folder="C:\Program Files\PMAIL\MAIL\Docfxit\" ; Live $Folder = "C:\Scratch\Scratch11\" ; Test $File = InputBox("Find and replace", "Name and/or path of the file", "Hierarch.pm", "", 500, 100) MsgBox(48, "Path\File", $Folder & $File) $FileContent = FileRead($Folder & $File, FileGetSize($File)) $Find = InputBox("Find and replace", "What to find?", "FindThisText", "", 500, 100) $Replace = InputBox("Find and replace", "What to write instead?", "ReplaceWithThisText", "", 500, 100) $Confirm = MsgBox(65, "Find and replace", "You are about to change every instance of " & $Find & " by " & $Replace & " in the file " & $File & @LF & "Are you sure? ") If $Confirm = 1 Then $sequence = $sequence + 1 FileCopy($Folder & $File, $Folder & $File & $sequence) $FileContent = StringReplace($FileContent, $Find, $Replace) FileDelete($File) FileWrite($File, $FileContent) EndIf
Thanks,
Docfxit