How to overwrite specific lines on text files

Posted by iTayb on Stack Overflow See other posts from Stack Overflow or by iTayb
Published on 2010-06-03T11:54:11Z Indexed on 2010/06/03 12:04 UTC
Read the original article Hit count: 293

Filed under:
|
|

I have two text files. I'd like to copy a specific part in the first text file and replace it with a part of the second text file.

This is how I read the files:

List<string> PrevEp = File.ReadAllLines(string.Format(@"{0}naruto{1}.ass", url, PrevEpNum)).ToList();
List<string> Ep = File.ReadAllLines(string.Format(@"{0}naruto{1}.ass", url, EpNum)).ToList();

The part in PrevEp that I need: from the start until it meets a line that includes Creditw,,0000,0000,0000.

The part I would like to overwrite in Ep: from the start to a line which is exactly Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text.

I'm not so sure how may I do it. Could you lend me a hand? Thank you very much, gentlemen.

© Stack Overflow or respective owner

Related posts about c#

Related posts about string