merge two files in a file
-
Hi, Can you tell me how to import a file in other file? thanks.
-
Hi, Can you tell me how to import a file in other file? thanks.
Depends on the format of the file. Would you like to tell us more about these files?
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website
-
Hi, Can you tell me how to import a file in other file? thanks.
What types of files? What do they contain? How do you want to 'merge' them? Are they text files and you want to append one to the other? Need more information.
Try code model generation tools at BoneSoft.com.
-
Hi, Can you tell me how to import a file in other file? thanks.
Adding to what the others said, while it's true that, for example, merging two XML files is not as simple as appending one to the other, it's also true that it's not possible to append a file at all, no matter what, you need to read your two files, merge them in memory and write them back out, either overwriting one of your existing files, or to a new file.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi, Can you tell me how to import a file in other file? thanks.
-
using (StreamWriter sw = new StreamWriter(@"C:\file1.txt") { using (StreamReader sr = new StreamReader(@"c:\file1.txt") { sw.Write(sr.ReadToEnd); } } Simple solution for text files... Hogan
using (StreamReader sr = new StreamReader(@"c:\file2.txt") { File.AppendAllText(@"c:\file1.txt", sr.ReadToEnd()); }
:)Luc Pattyn [My Articles] [Forum Guidelines]
-
using (StreamReader sr = new StreamReader(@"c:\file2.txt") { File.AppendAllText(@"c:\file1.txt", sr.ReadToEnd()); }
:)Luc Pattyn [My Articles] [Forum Guidelines]
-
Nice; a real compact framework would offer
File.Append("file1.txt", "file2.txt");
Luc Pattyn [My Articles] [Forum Guidelines]
-
Nice; a real compact framework would offer
File.Append("file1.txt", "file2.txt");
Luc Pattyn [My Articles] [Forum Guidelines]
-
Depends on the format of the file. Would you like to tell us more about these files?
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website
-
:confused: I'm allways surpriesed how there can be no reacton from the one who has a problem, after a response 9 minutes later. But maybe it's because the question had no "urgent" in the subject line! All the best, Martin
Martin# wrote:
I'm allways surpriesed how there can be no reacton from the one who has a problem, after a response 9 minutes later.
It just goes to show you that too many people haven't got even the most basic of manners. Possibly they found the answer but just don't have the common courtesy to respond back to say they've got a solution. Or they really don't understand their own problem and are embarrased that they can't articulate themselves.
Martin# wrote:
But maybe it's because the question had no "urgent" in the subject line!
Just like this one[^] :rolleyes:
Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... "I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless." Ready to Give up - Your help will be much appreciated. My website
-
Hi, Can you tell me how to import a file in other file? thanks.
thank you for helping me