October 31, 2025, 12:23:48 PM

News:

IWBasic runs in Windows 11!


Shortening flat files?

Started by JoaoAfonso, December 25, 2009, 09:51:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

Good evening.
I am posting to ask something I've tried sometimes without luck:
- I have a database with lots of rows  (>65k)
- Each row means one item.
- Each row has many information about that item, spread in multiple columns.
- I want to have a field for each item where one can type free text.

To do this, I created a .txt file per item. Anyway, even if with one character only in that file, each files occupies too much space, so having 65k files of 5 characters each, lets say, that occupies around 200Mb in hard disk.
Is there a way to make those files occupy just the true size?
Is there a way to make a column in database that can handle big text?
What other solutions I have to do this?

Thanks in advance.
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

JoaoAfonso

As supposed, could fix it using a column with Memo type in my Access DB. I can be abit limited this way, but at least meanwhile works ok.
If I want to associate a picture to each item, how can I save it in DB? I use link to .bmp files, but is there a way to implement it inside DB?
Thanks
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

LarryMc

Quote from: JoaoAfonso on December 25, 2009, 11:38:22 AM
As supposed, could fix it using a column with Memo type in my Access DB. I can be abit limited this way, but at least meanwhile works ok.
If I want to associate a picture to each item, how can I save it in DB? I use link to .bmp files, but is there a way to implement it inside DB?
Thanks
A database with multiple memo fields is what I used for the Snippet Manager.  The parctical size of the contents of a memo is really limited to the size of the ISTRING you allocate to hold it's contents when reading and writing.

The way that I handled images and other binary files was to have a single associated 7-zip file with the database file.
The database had a field for the real name of the image and a unique file name I created.  That way different records could have different images that had the same file name within the 7-zip file.

Just remember that memos consume memory in blocks; I think 512 bytes at a time(can't remember for sure)
So don't use a memo to store a filename or you'll be wasting memory.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

JoaoAfonso

Yes, I haven't done that.
But the problem I am trying to solve is exactly that: if there is a chance of saving a bmp file into a field of a database, or if the correct solution is having those extra picture files associated to each item (DB row).
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900