Hello,

I'm about to write a prog which saves Text into lots of different named files which are always increasing in number from 1 to ???????
I assume there will be around 10.000+ files per week.

Now the Text file will have a certain format:



001
Image.bmp
This is Text.This is Text.This is Text.
This is Text.This is Text.This is Text.
This is Text.This is Text.This is Text.
This is Text.This is Text.This is Text.


The first number is an Identifier in which all TextFiles need to get sorted to first.

Then all files of that identifier should get sorted by the Text in alphabetical order.

It looks to me that this needs a database to do so.

Could anyone point me into the direction of what is needed (a basic outline) and maybe a working example.

Thanks in advance,
JimmyC
Posted on 2003-10-11 12:39:58 by JimmyClif
well you should have something like

a unique key
identifier
bmp_location (don't store big binary objects in a database if you don't really have to)
text

in most databases that breaks down to the following SQL:

CREATE TABLE `jimmy` (
`jimmy_id` INT,
`identifier` INT NOT NULL,
`bmp_location` CHAR(255) -- max path length is 255 isn't it?,
`ourtext` TEXT NOT NULL,
PRIMARY KEY(`jimmy_id`)
);

it varies from database to database, consult their manual. If your db is capable of doing so you may wish to make `identifier` a foreign key to a field in a table of valid identifier keys that way no wrong data can be entered.

getting it out in selected sorted order would be

SELECT * FROM `jimmy` ORDER BY `identifier`, `ourtext` ASC;
Posted on 2003-10-11 15:13:41 by Hiroshimator