473,797 Members | 2,893 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Appending multiple RTF file into one

49 New Member
Can anyone help me out in this? I want to append multiple RTF file into one RTF file. I tried using 'streamwriter', the resulting file size becomes big and when i open it, it is the original i.e the first RTF file only and not the appended one. But i open the file with notepad it looks appended. I've supplied my code below . I've searched thru internet a lot but didn't get anything. So if anybody hav a solution plz help me out.

I'll explain something 'bout the code.
File in path1 is a new blank file i.e to b created.
File in path2 and path3 have contents.

using system;
using system.IO;

try
{
string path1 = @"C:\amit.rt f";
string path2 = @"C:\T0000072.r tf";
string path3 = @"C:\T0000073.r tf";
FileStream file2 = new FileStream(path 2, FileMode.OpenOr Create, FileAccess.Read Write);
FileStream file3 = new FileStream(path 3, FileMode.OpenOr Create, FileAccess.Read Write);
StreamReader sr2 = new StreamReader(fi le2);
StreamReader sr3 = new StreamReader(fi le3);
string s = sr2.ReadToEnd() ;
string s1 = sr3.ReadToEnd() ;
StreamWriter sw1 = new StreamWriter(pa th1);
sw1.WriteLine(s );
sw1.WriteLine(s 1);
sw1.Close();
sr2.Close();
sr3.Close();
}
catch(Exception ex)
{
Console.WriteLi ne(ex.Message.T oString());
}
Dec 11 '06 #1
0 1062

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2120
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I understand that now and it seems to be fixed but the data I'm pulling from the HTML fields is not being appended correctly do my Access DB....The field in the DB now reads " ' ". I understand why it does that (my function) but what I need it to read is...
1
1804
by: Eli Sidwell | last post by:
I have an Access DB that contains 5 tables for the last 5 years. All 5 tables have the same structure. I wanted to keep each year separate for organizational purposes. But, I want to query all 5 tables with one query for an application. What would an query look like that uses all 5 tables as a source ? Should I create a view that inserts all 5 tables into a recordset ? (Wouldn't this be resource heavy ?)
13
2621
by: sherifffruitfly | last post by:
Hi all, I'm trying to distill all of the info from google searches into what I need, with partial success. In truth, the whole xmlNode, Document, Element, etc group of classes & methods is going over my head - lol! The structure of the xml file I'm trying to append to is as follows: <?xml version="1.0" encoding="UTF-8"?> <!-- stuff -->
0
1556
by: HydroPnik | last post by:
Hi all! What a great community you have here. Being an Access newbie I have already used much information gleaned from the other posters for my current project. I have been tasked with creating a database that will link to a table ("tbl_Data File) located in another database ("Database1"). Changes will be made to a customer record queried from Database1 and saved in a table located in Database2 called "tbl_Instructions". So far I have...
2
1520
by: Vivek | last post by:
Hi, Iam using the db2load API to write data to a table. I see that by default the load process creates/overwrites the msgfile. Is there a way to change this behaviour so that messages are appended to an exisiting msg file. Thanks, Vivek
7
2852
by: Someone11 | last post by:
Ok not sure if this is where im meant to post my problem. But currently i'm generating a report through a webpage coded using vb.net. I create the reporitng service and set the credentials and then set the render arguments. i then call the reportingservices.render method to generate the report which all works fine. Currently the report takes in one paramater, in this case a invoice number and the report returned is an invoice. The report...
1
3967
by: Frank | last post by:
Hi, Let's say I have a file named myFile.xml Within that file I have blocks of data which I'd like to add at different times during the day. e.g. <LogEntry>
2
1513
by: sarada purkait | last post by:
hii i have to write into a file from the start and then go on appending to it .. i tried using ( ios::out|ios::app) but by this the file keeps on appending every time i run the program and the file ends up containing valuers from the previous runs as well... actually i am using a loop , which generates different values which are to be added to the file . can some1 help me with this i am fairly new to c++
9
3143
by: JWM81274 | last post by:
Is there a statement that will allow appending to the end of table when inserting new data? I use multiple "insert into table1(timestamp1,area1,value1,value2...)" to insert different area data with the same timestamp into the same table. When I look at the data in the table sometimes the rows are placed randomly into the table. When I queue a php script to display the data for a particular day the order changes because the order in the table...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9536
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10468
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10245
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10021
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7559
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6802
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4131
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.