Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

merge xml files into one c#

using (var output = File.Create(originalFileName))
{
  foreach (var file in new[] { "File1", "File2" })
  {
    using (var input = File.OpenRead(file))
    {
      input.CopyTo(output);
    }
  }
}
Comment

c# merge two xml files

var xml1 = XDocument.Load("file1.xml");
var xml2 = XDocument.Load("file2.xml");

//Combine and remove duplicates
var combinedUnique = xml1.Descendants("AllNodes")
                          .Union(xml2.Descendants("AllNodes"));

//Combine and keep duplicates
var combinedWithDups = xml1.Descendants("AllNodes")
                           .Concat(xml2.Descendants("AllNodes"));
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# windows forms open directory in explorer 
Csharp :: how to print statement in c# 
Csharp :: checking if a list contains a value unity 
Csharp :: c# file watcher 
Csharp :: Dyanmically create datatable in c# 
Csharp :: check property type of collection c# 
Csharp :: get file path in .net core from wwwroot folder 
Csharp :: how to append something to a string in c# 
Csharp :: c# create array with n elements 
Csharp :: c# template 
Csharp :: how to get row index of selected row in gridview asp.net webforms 
Csharp :: c# Predicate delegate 
Csharp :: rotate gameobject unity 
Csharp :: LINQ query on a DataTable C# 
Csharp :: pyautopgui wrros on big sur 
Csharp :: how to skip bin/Debug/netcoreapp3.1/ on the reltaive path 
Csharp :: get all classes that extend a class c# 
Csharp :: decrease image size C# 
Csharp :: make 2D object move at constant speed unity 
Csharp :: c# example code 
Csharp :: c# yield keyword 
Csharp :: variable size in memory c# 
Csharp :: disabling a button if textbox is empty c# 
Csharp :: get device name c# console 
Csharp :: C# unit test exception using attribrute 
Csharp :: c# datetime remove days 
Csharp :: and operator in c# 
Csharp :: animation setbool unity 
Csharp :: remove scenedelegate 
Csharp :: jagged array to 2d array c# 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =