GNU sed - Search and Replace problem

Hi,

The following code loops through every file with an error extension and then loops through all XML files in that directory and replaces the target character @ with / . The problem I have is that if there is more than one occurance of @ in each individual file it doesn't replace it. Any ideas???

P:
for %%f in (.error) do (
for %%g in (%%~nf\
.xml) do (

IF findstr /L /M /C:@ %%g > nul && "C:\Program Files\GnuWin32\bin\"sed -i -B s/@/\// %%g && rename %%f %%~nf.finished && echo Changes made to %%g >> C:\AnnuityErrors.log
)
)
C:

you have to use the global flag "g" at the end

sed -i -B s/@/\//g

Thanks very much, it works like a dream.:slight_smile: