Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Merging Two Text Files
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00948382
Message ID:
00948974
Views:
15
Hi Martin,

Look at the StreamWriter class. In the constructor, it has the ability to append text to a file.


>Good afternoon to ol!!!
>
>I would just like to know how to merge two text files into one. Using DOS command is simply:
>
>Copy File1.txt+File2.txt File3.txt
>
>In DotNET I tried:
>
> File.Copy(cPath & "File1.txt + " & cPath & "File2.txt", cPath & "File3.txt")
>
>... and ...
>
> File.Copy(cPath & "File1.txt" + cPath & "File2.txt", cPath & "File3.txt")
>
>... but both commands just gave out an error. Any ideas on how this can be achieved?
>
>Actually, what I am trying to achieve here is to append a line into File2.txt. File1 is a header file that contains summary information regarding the records in file2. If anyone know how I can insert a line of text to the very 1st line of the text file, that would be even better!
>
>Thanx! in advance!!!
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform