我有一个文本文件,我想从文件中删除一些字符 [英] I have an text file I want to remove some characters from the file
本文介绍了我有一个文本文件,我想从文件中删除一些字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文本文件,我想删除文本文件中的第5/3行,所以我如何解决它请帮助..
I have a text file and I want to remove say line no 5/3 from the text file,so how I solve it please help..
推荐答案
为了删除文件中的数据,您必须:
- 将文件读入内存缓冲区。
- 从内存缓冲区中删除正确的数据。
- 将修改后的内存缓冲区写回文件(从而覆盖它)。
In order to remove data inside a file you have to:
- Read the file into a memory buffer.
- Remove proper data from the memory buffer.
- Write back the modified memory buffer into the file (thus overwriting it).
这篇关于我有一个文本文件,我想从文件中删除一些字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文