|should not be hard, but you forgot to explicate the problem more specifically.|
does this string occur in the same file as the "product id"?
if not the same file, is the string in one file or multiple files?
does it occur only once?
what portion of the researchID do you want to put into productID? all the quoted part "KR..." or just part of it?
these might be dumb questions, i don't know, but since no one else has responded i will risk looking foolish.
here's something to try and start out with:
(ffile source of fix-data, idfile is file to fix; newfile is output)
setlocal enabledelayed expansion
for /f "tokens=1 delims= " %%a in ('find "<researchID=" ffile') do (
set /a ct=0
for /f "tokens=* delims=" %%a in (idfile) do (
set /a ct+=1
if ct equ 1 (
echo !line! >> newfile)
move /y newfile idfile
code not tested, make backup of idfile or disable last line!