I need to replace a single line in a file. Generally, this code works fine:
(The actual specifics on what this block is doing is not necessary for this question).
You could solve this with pure batch!
:readLongLine < longline.tmp ( for /L %%n in (1 1 20) do set /p part[%%n]= )
After this your line is splitted into the variables part[1] .. part[20]
part[1]
part[20]
Writing this to a new file you could use
:writeLongLine longLine2.tmp