not exactly sure what your asking but if you simply want to overwrite line #17 with new text then perhaps use the -l# switch if i understand you are deleting line 17 then writing to line 17 again you can just overwrite with -l#
/write -l5 c:\info.txt This line will overwrite the 5th line in the file