Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've created a data text file with Streamwriter which ends with a terminator line of text. How do I remove the terminator line of text and append to that file then adding the terminator line of text at the end of the new appended section?

Thanks
Paul Bayley
Posted
Comments
Paul Bayley 25-May-10 7:43am    
Thanks for that. I'm still a bit of a beginner so I'll need to do a bit of homework on the Stringbuilder Class. I've already had a quick look at the MSDN Library topic.
Thanks for pointing me in the right direction.
Paul Bayley

1 solution

* read the file into a stringbuilder object.
* find, then remove the terminator line.
* append text.
* append terminator line.
* save again to txt file (overwrite the existing file).

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900