In a program I am writing I need to be able to write to a specific line in a textfile. I don't know of anyway to do this except just rewriting the whole textfile which would be a pain to do. Does anyone know how to do this? To clear up any confusion that may have been caused I'll try to show what needs to be done.

This is the textfile I have

I need to write a specific string into here

The extension list could go on for a while and would take a lot more coding to rewrite the file.