Hello, I have such a question, how to add text to a new file, to certain lines, for example, to the first line, etc.
using System; using System.IO; using System.Text; using System.Xml; using System.Text.RegularExpressions; public class FailR { public static void Main(string[] args) { string Path = @"C:\Users\Desktop\1\1.MST"; string Paths = @"C:\Users\Desktop\1\01.xml"; int Stroka = 9; string[] AllLines = File.ReadAllLines(Path); using (StreamWriter s = new StreamWriter(Paths)) for (int i = Stroka; i < AllLines.Length; i++) { s.WriteLine(AllLines[i].Replace(".", "255 ").Replace("X", "002 ").Replace("1", "001 ").Insert(0, "<Row><![CDATA[ ").Insert(202, " ]]></Row>")); } } }