| | |
How to merge two text files
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2008
Posts: 1,735
Reputation:
Solved Threads: 186
Firstly, think of how you would want to do it, write it down.
Work out some code that looks like it should do what you wanted.
try it, what does it do?
if it doesnt work, post it, explain what you're getting you didnt expect, and ask for assistance.
Dont post just asking for us to do it for you
Work out some code that looks like it should do what you wanted.
try it, what does it do?
if it doesnt work, post it, explain what you're getting you didnt expect, and ask for assistance.
Dont post just asking for us to do it for you
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
•
•
Join Date: Feb 2008
Posts: 46
Reputation:
Solved Threads: 4
hi
try using namespace System.IO;you will find two classes responsible for reading and writing from file with more options are :
- StreamReader ;
- StreamWriter ;
u can read ur file using StreamReader the write it using StreamWriter
but after using ur StreamReader and Writer close them EX :
StreamReader sr = new StreamReader(Strin Path);
TextBox1.Text=sr.ReadLine();
sr.close(); ------------> close reader;
and the same with Writer ;
there is another class File contains static members
File.ReadAllText();
File.WriteAllText();
File.open(string path , filemode.append);
all these depends on ur application if u wana preview ur text file and append with another file or u wanna do ur method during procesisng ur code ;
there is more but that easy ways u can append ur txt files
bye
try using namespace System.IO;you will find two classes responsible for reading and writing from file with more options are :
- StreamReader ;
- StreamWriter ;
u can read ur file using StreamReader the write it using StreamWriter
but after using ur StreamReader and Writer close them EX :
StreamReader sr = new StreamReader(Strin Path);
TextBox1.Text=sr.ReadLine();
sr.close(); ------------> close reader;
and the same with Writer ;
there is another class File contains static members
File.ReadAllText();
File.WriteAllText();
File.open(string path , filemode.append);
all these depends on ur application if u wana preview ur text file and append with another file or u wanna do ur method during procesisng ur code ;
there is more but that easy ways u can append ur txt files
bye
•
•
•
•
Originally Posted by BlackSun
TextBox1.Text=sr.ReadLine();
What's the relevancy with this question ?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
That's very inventive BlackSun.
But if I drink wine I use a wineglass.
When I drink a coffee I use a coffeecup.
Do you drink wine from a coffeecup?
Don't use a textbox for this, but use a string.
But if I drink wine I use a wineglass.
When I drink a coffee I use a coffeecup.
Do you drink wine from a coffeecup?
Don't use a textbox for this, but use a string.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Similar Threads
- How can show/view Infopath dynamic files(xml) without infopath in a computer (XML, XSLT and XPATH)
- Help with automatic update problem and more (Viruses, Spyware and other Nasties)
- Merge Files , in c++ (C++)
- Trying to get a program to extract data from a text file (C++)
- how to read many text file? (C++)
- Merge Sort (C++)
- How to handle multiple files, to Excel (VB.NET)
- Trying to compare the contents of two text files and save the difference (Python)
- How to open multiple textfile (Visual Basic 4 / 5 / 6)
Other Threads in the C# Forum
- Previous Thread: want to login to windows through c#
- Next Thread: Problems with transaction in SQL Server Mobile
| Thread Tools | Search this Thread |
.net access ado.net algorithm animation array barchart bitmap box broadcast buttons c# check checkbox client code combobox control conversion csharp custom database datagrid datagridview dataset datastructure datetime degrees development directrobot draganddrop drawing encryption enum event excel file form format forms function gdi+ hash httpwebrequest image index input install java label lisp list listbox mandelbrot math mouseclick mp3 mysql native operator path photoshop picturebox pixelinversion post print process programming radians regex remote remoting richtextbox safari server sleep snooze socket sql statistics stream string table tables tcp text textbox thread time timer update usercontrol usercontrols validation visualstudio webbrowser windows winforms wpf xml






