Which is the Best Way To Edit a Text File 
Author Message
 Which is the Best Way To Edit a Text File

Hi All,

Which is the best method of editing a text file using System.IO   ?
I want to edit some existing lines in it and save.

TIA,
NumLock



Mon, 28 Mar 2005 19:43:19 GMT  
 Which is the Best Way To Edit a Text File
NumLock,

    I would use the FileStream class to create the underlying stream, and
then use a StreamWriter class to write the text.  Just make sure that you
are using the correct encoding when you write to the underlying stream.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> Hi All,

> Which is the best method of editing a text file using System.IO   ?
> I want to edit some existing lines in it and save.

> TIA,
> NumLock



Mon, 28 Mar 2005 21:28:05 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. are there better ways to read config file?

2. Help with ideas, best ways etc...

3. Good ways to obfuscate/mangle strings?

4. Any good ways to trace memory leaks?

5. Editing text file in c

6. Editing a text file

7. Editing a text file

8. Text Editing Resources (.rc files)

9. Wanted: locating positions in edited text files

10. Problem editing big text files

11. Show text file in edit box ?

12. Text to Rich Edit conversion on read from file

 

 
Powered by phpBB® Forum Software