我有这样的文字文件:
Back to the future PG 1h 13m November 24 1989
Star wars episode 5 12 2h 58m May 20 1980
Star wars episode 6 12 2h 58m June 2 1983
Furious 7 15 137m April 3 2015
如何从文件中删除选定的行?
由于
答案 0 :(得分:1)
Open the file. Open an output file.
Read the lines in sequence. For each line,
If the line does *not* match the input text,
write the line to the output file.
输出文件现在包含所需的行。