I'm trying to modify some .htm
files, replacing Name1 Lastname1, Name2 Lastname2
with Name1 Lastname1
.
I found something here, and changed the code for my needs:
REM @echo off
setlocal disableDelayedExpansion
:Variables
set "_strFind=Titel: Name1 Lastname1, Name2 Lastname2<br>"
set "_strInsert=Titel: Name1 Lastname1<br>"
set /p PC=PC?:
set /p Name=Name?:
set InputFile=\\%PC%\C$\Users\%username%\AppData\Roaming\Microsoft\Signatures\GR.htm
set OutputFile=\\%PC%\C$\Users\%username%\AppData\Roaming\Microsoft\Signatures\GR1.htm
:Replace
">"%OutputFile%" (
for /f "usebackq delims=" %%A in ("%InputFile%") do (
if "%%A" equ "%_strFind%" (echo %_strInsert%) else (echo %%A)
)
)"
This didn't do anything; what did I do wrong? and how can I find the mistake?
EDIT01:
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Arial",sans-serif'> John Doe GmbH<br>
Blabla: John Doe, Johnny B.Good<br>
Bla bla bla<br>
Partner:<br>
Bla bla bla bla <o:p></o:p></span></p>
</td>
And I'd like to remove the , Johnny B.Good
part.
John Doe GmbH
And i'd like to remove the ", Johnny B.Good" part. – heyjonny May 20 '19 at 10:28Blabla: John Doe, Johnny B.Good
Bla bla bla
Partner:
Bla bla bla bla
`, and you want to replace everything from and including **`,`** with `
`. – Compo May 20 '19 at 10:56