joker77 Posted February 28, 2007 Posted February 28, 2007 Hi, This may be a fairly straightforward one, but not having done much work in this area I just wanted to throw it out there I'd like to take a file, and prepend some data to it. This has to be done for several file types: PowerPoint presentations (.ppt) - take an existing presentation, and insert a new first slide Word Documents (.doc,.docx) - take a word document, add a new first page Sound Clips, Podcasts (.mp3,.mwa) - take a clip, and prepend a new start section Video Clips (.wmv,.mpeg) - same as for sound except with video Anyay, you get the general jist! Is this a case of just using a StreamReader and Streamwriter to create a new file based on merging the 2 existing ones?? Thanks Quote What if the Hokey-Pokey IS what it's all about?
mskeel Posted February 28, 2007 Posted February 28, 2007 The problem I see is that by writing anything to the beginning of any of these file types you will likely damage the headers rendering the files unusable by the programs that use them. If that isn't a problem, then you should be able to do as you stated above, merge the two files. Quote
joker77 Posted February 28, 2007 Author Posted February 28, 2007 yea was kind of thinking along those lines myself, the header info would get corrupted. Maybe someone has done something similar, or there's tools around for various differnet type of files like mpegs, mp3s or Word Documents Quote What if the Hokey-Pokey IS what it's all about?
Leaders snarfblam Posted February 28, 2007 Leaders Posted February 28, 2007 The technique for each file type would be different. If you just prepend one file to another, most programs will probably only open the prepended data (based on the header from the prepended document) and ignore the remaining data. To do this properly, you have to work with the format of the documents. With office documents you could probably just interop with office. With audio and video files you would probably need special libraries, and even then the particulars can vary from format to format. In other words, you are looking at alot of work. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.