473,721 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing multiple text files inone file.

Hey all, just wondering if anyone can point me in the right direction. I'm
developing a solution that allows a user to store multiple text-based
content (like code snippets, notes, documents etc.) in one master document.
I'm not exactly sure which is the most efficient method of going about
this. Should I:
a. Use a container file like a CAB file and read/write separate textfiles
to it?
b. Save all "documents" in a collection and serialize to a file?

the second option is the one I'm leaning towards, but then I run into
versioning problems (new builds of the application/class wont read the
serialized object). I'm at a loss here. I've looked at Treepad Lite and
it's method of storing files, but for the life of me I'm not sure how it's
done. A little help from you pros out there would be very much appreciated!
Thank you!

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #1
2 1743
"Chris Murphy via DotNetMonster.c om" <fo***@DotNetMo nster.com> schrieb:
Hey all, just wondering if anyone can point me in the right direction. I'm
developing a solution that allows a user to store multiple text-based
content (like code snippets, notes, documents etc.) in one master
document.
I'm not exactly sure which is the most efficient method of going about
this. Should I:
a. Use a container file like a CAB file and read/write separate textfiles
to it?
b. Save all "documents" in a collection and serialize to a file?

If the purpose of the file is only to store a set of files, I'd prefer to
use CAB, ZIP or a similar file format. This will allow the user to use
other applications to open the file too.

Microsoft Cabinet Software Development Kit
<URL:http://support.microso ft.com/?scid=kb;EN-US;310618>

You can build CAB files using the "MAKECAB.EX E" utility that is IIRC
included in Windows. For extracting CAB files, you can use Microsoft's
"EXTRACT.EX E", which is available on the Windows XP CD or as part of the
Windows XP Support Tools:

<URL:http://groups.google.d e/groups?selm=u%2 4EaZ074EHA.1296 %40TK2MSFTNGP10 .phx.gbl>

Alternative you can use p/invoke on 'SetupIterateCa binet'. A VB6 sample can
be found here:

View and Extract CAB File Contents Programmaticall y
<URL:http://www.thescarms.c om/vbasic/CabExplorer.asp >

The Zip, GZip, BZip2 and Tar Implementation For .NET
<URL:http://www.icsharpcode .net/OpenSource/SharpZipLib/>

The VB.NET Resource Kit contains zipping functionality too (note that the
Resource Kit is not available any more, so the answer applies for the case
that you already
have a copy of the Resource Kit):

The Visual Basic .NET Resource Kit
<URL:http://msdn.microsoft. com/vbasic/vbrkit/>

It contains ComponentOne Zip for .NET:

ComponentOne Zip™ for .NET
<URL:http://www.componenton e.com/products.aspx?T abTypeID=1&Item Type=1&PanelInd ex=14&ItemID=53 569&SubCategory TypeID=0&TabMap ID=57&TabID=70>

Using J#'s zip functionality:

Using the Zip Classes in the J# Class Libraries to Compress Files and Data
with C#
<URL:http://msdn.microsoft. com/msdnmag/issues/03/06/zipcompression/>

..NET 2.0 will contain ZIP support too.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Excellent! Thanks for the advice -- I think I'll use it for performing
backups of the file itself.

I've actually ended up taking a totally left field approach to my many-in-
one serialzation issue. I've extended a Treeview control and addded some
drag/drop funtionality and serialization/deserialzation to xml support. It
works like a dream, and even better makes, my generated files more portable!

--
Message posted via http://www.dotnetmonster.com
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6597
by: Charlie | last post by:
Hello, I have data in an Access table that I would like to export to multiple HTML tables. I would like to split the data in the Access table (about 92,000 records) into multiple HTML tables/files to reduce download time and bandwidth usage on my web server. That way, the user can select a particular page to download instead of downloading a page with all of the records. I would like to set a limit of only 500 records per file.
5
3440
by: Buddhist[CHinA] | last post by:
The text files are not only the .txt files, but also all ascii files. Thx.
9
8861
by: malla | last post by:
Hi, I am trying to open a bunch of files and get data from them into one single file. I am sure this process can be automated if I name the files that I want to open in a regular pattern (say 1.txt, 2.txt, 3.txt, ...) Has anyone done sth like this before? Is there a way to achieve this easily? Please share.
2
2719
by: ManningFan | last post by:
I'm running through a database in a loop, and each time the loop finishes I would like to export the values of some variables to new text files. In reality it's more complex than this, but this is the simplest way to state it. Is there a way to write to text files and save them as different names (presumably one of the variables dot "TXT") using Access VBA?
3
5705
emaghero
by: emaghero | last post by:
Hello all, I want to open multiple txt files with similar names in C++ I have attempted this with the following code //Create as many txt files as there are valid propagation constants //Propagation constants are elements of the vector beta for(int j=0;j<(int)(number_of_nodes);j++){ if(*(beta+j)>substrate*k && *(beta+i)<core*k){ FILE *p_j; p_j=fopen("c:\\data_j.txt","w"); }
6
30728
by: borthouth | last post by:
Hi, I have just started using Python and I am slowly getting into it. I wanted to make a little script to merge all files in a directory into one. All of these files will be text files. I know I need to use os.path.walk() to walk through all the files, and if not os.path.isdir(filename) with open(filename,'r').read() to read all the files that are not directories. Can someone give me a clue or a very simple example that I can work...
3
2156
by: ezra | last post by:
I need to run a monthly audit on a customer invoice database that prints off order totals per customer. Ex. If customer 1234 has 4 orders for the month I want to see the text file as follows: 1234 10.21 101.22 22.11 82.01 (The OrdersTotaltbl already stores the order totals and CustID). The problem for me is that I need to output a separate file for each customer file saved as the CustID. There is currently a list of 200+ regular customers...
2
4203
by: as001 | last post by:
Hi, I'm writing a windows application in C# using VS 2003. I got stuck where it has to write multiple output text files. Here's my piece of code: for loop { Random r = new Random(); //use millisecond and random to avoid similar filename
5
14670
by: maral | last post by:
Hi every one, this is my first post here! I'm using GATE toolkit for information retrieval and text analysis, but i really need java for some parts. I have managed to find a specific word in one text file, but i need to look for a specific word, in multiple text files. all of the files are ".txt" and they are in the same folder but each of them with different names. I have written the following code: but i receive an error that i don't...
0
8840
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
8730
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
9215
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
8007
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4484
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4753
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3189
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
2
2576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2130
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.