collection of plain text files as a database
Started by jimspoon
on 6/15/2011
jimspoon
6/15/2011 6:50 pm
A simple idea. A database could consist of one plain text file for every record. Data fields and values for the record could be specified very simply, one per line.
For example:
Note = "Bought some widgets today at Ace Hardware."
Date: "6/15/2011"
Time: 13:33
vendor:name: "Ace Hardware"
item.manufacturer: "WidgetsRUs"
item.description: "Widget"
item.quantity: 4
item.price: 2.99
Queries could be made against a collection of such files, and results could be returned in a grid. In other words, the "database" is assembled from the files on the fly with every query. You could even have a many to one relationship - e.g. in above example, if another set of "item." fields were appended.
Problems: inefficient, slow, subject to error. Perhaps the files could be indexed to ease the performance problem.
Advantage: simplicity, data accessible and editable by any program that understands the format.
Advantages over CSV files: Ability to specify a record over more than one line. Ability to include only "filled-in" fields. Ability to put fields in any convenient order. No need to put fields in same order on every line, no need for extra commas in place of empty fields.
Is there any program out there that works in this way?
One example just came to mind - Windows Mail - in which each email is stored as a plain-text EML file. But obviously this is not a general-purpose usage.
For example:
Note = "Bought some widgets today at Ace Hardware."
Date: "6/15/2011"
Time: 13:33
vendor:name: "Ace Hardware"
item.manufacturer: "WidgetsRUs"
item.description: "Widget"
item.quantity: 4
item.price: 2.99
Queries could be made against a collection of such files, and results could be returned in a grid. In other words, the "database" is assembled from the files on the fly with every query. You could even have a many to one relationship - e.g. in above example, if another set of "item." fields were appended.
Problems: inefficient, slow, subject to error. Perhaps the files could be indexed to ease the performance problem.
Advantage: simplicity, data accessible and editable by any program that understands the format.
Advantages over CSV files: Ability to specify a record over more than one line. Ability to include only "filled-in" fields. Ability to put fields in any convenient order. No need to put fields in same order on every line, no need for extra commas in place of empty fields.
Is there any program out there that works in this way?
One example just came to mind - Windows Mail - in which each email is stored as a plain-text EML file. But obviously this is not a general-purpose usage.
jimspoon
6/15/2011 7:00 pm
Other examples come to mind. Vcard / VCF files for contacts - and I see that iCalendar also has the same concept for a number of different types of records:
http://en.wikipedia.org/wiki/ICalendar
But do any programs work with VCFs / VCalendar files as their native format (i.e. not just an import/export format)?
http://en.wikipedia.org/wiki/ICalendar
But do any programs work with VCFs / VCalendar files as their native format (i.e. not just an import/export format)?
Achim
6/15/2011 11:51 pm
Hi,
perhaps GS-Base could be intersting for you (see post above)
best regards
Achim
perhaps GS-Base could be intersting for you (see post above)
best regards
Achim
Zman
6/16/2011 12:05 am
seems like that was the premis behind asksam - though I haven't used it since DOS days
z
z
Stephen Zeoli
6/16/2011 3:22 am
What you are describing sounds very similar to the way Zoot worked before its recent update. Plain text files with delimited field headings in the body of the note, which could also be displayed in tabular form in the grid.
Steve Z.
Steve Z.
JohnK
6/16/2011 12:54 pm
You don't need to be a programmer to put this kind of thing together yourself.
Many years ago I got bored waiting for my employer to buy a long-promised database for our newspaper reporters and photographers to use as a photo job order/record system.
So I Googled and found a few bits of open-source code that would collect the data from a web form and pour it into a plain text database. Not separate files in this case, just a single plain text file with delimiters.
I had to learn enough Perl to add a couple of lines of code to add a feature (sorting, I think). Took an hour or two, it's not rocket science. Most of my own effort was in designing the web forms/pages to input and view/filter the data, which was straightforward, if you've done a little HTML. Then I just had to persuade the IT guys to give me a little server space (I was a journalist on the paper)...
Plain text files are fairly robust, so long as data volumes are modest. That $0 database was bullet-proof, even if I say so myself. Crude, but effective, as they say. The very fancy and very pretty $10,000 "pro" database system we eventually bought to replace it kept falling over! There's a lesson there somewhere...
There's a whole world of code "snippets" on there on the web, much of it open source, that will do the work for you, you just need to knit it together. And it's a nice challenge.
Many years ago I got bored waiting for my employer to buy a long-promised database for our newspaper reporters and photographers to use as a photo job order/record system.
So I Googled and found a few bits of open-source code that would collect the data from a web form and pour it into a plain text database. Not separate files in this case, just a single plain text file with delimiters.
I had to learn enough Perl to add a couple of lines of code to add a feature (sorting, I think). Took an hour or two, it's not rocket science. Most of my own effort was in designing the web forms/pages to input and view/filter the data, which was straightforward, if you've done a little HTML. Then I just had to persuade the IT guys to give me a little server space (I was a journalist on the paper)...
Plain text files are fairly robust, so long as data volumes are modest. That $0 database was bullet-proof, even if I say so myself. Crude, but effective, as they say. The very fancy and very pretty $10,000 "pro" database system we eventually bought to replace it kept falling over! There's a lesson there somewhere...
There's a whole world of code "snippets" on there on the web, much of it open source, that will do the work for you, you just need to knit it together. And it's a nice challenge.
