Answer the question
In order to leave comments, you need to log in
How to make correct output in a file?
There is a code that cuts out the information I need. (But not correctly)
string[] lines = File.ReadAllLines("C:\\1.xml");
IEnumerable<string> xmlLines = lines.Where(x => x.Contains("<Types>"));
HashSet<string> xmlLinesHashSet = new HashSet<string>(xmlLines);
string[] sorted = xmlLinesHashSet.ToArray();
File.WriteAllLines ("C:\\2.xml", sorted);
<Types>1526 1528765 </Types>
<Types>1526 152025 </Types>
<Types>1572 152761 152662 </Types>
1526 1528765 1526 152025 1572 152761 152662
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question