473,413 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

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 1719
"Chris Murphy via DotNetMonster.com" <fo***@DotNetMonster.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.microsoft.com/?scid=kb;EN-US;310618>

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

<URL:http://groups.google.de/groups?selm=u%24EaZ074EHA.1296%40TK2MSFTNGP10.phx. gbl>

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

View and Extract CAB File Contents Programmatically
<URL:http://www.thescarms.com/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.componentone.com/products.aspx?TabTypeID=1&ItemType=1&PanelIndex=14 &ItemID=53569&SubCategoryTypeID=0&TabMapID=57&TabI D=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
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...
5
by: Buddhist[CHinA] | last post by:
The text files are not only the .txt files, but also all ascii files. Thx.
9
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...
2
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...
3
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...
6
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...
3
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...
2
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();...
5
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...
0
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...
0
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,...
0
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...

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.