Simple database

James Wilkinson james at westexe.demon.co.uk
Thu Jul 22 23:16:52 UTC 2004


Nifty Hat Mitch wrote:
> A pile of notes sounds like a pile of text files.
> 
> Organize them in a directory with sane file names.
> 
> Edit them into a simple but consistant format that permits
> you to search with 'grep'.
> 
> If you want to think about fields use an XML/HTML sort of structure to
> tag blocks of text and key words.
> 
>     <Title> Good title </Title>
>     <Index> word list </Index>
> 
> Once you do this sort of homework it begins to make sense how you wish
> to import this stuff into a data base.  The data base might only
> contain key words and file names.  It need not contain the full text
> of the files.

Great idea.

I'd question, though, whether XML isn't overkill for this sort of
application. If the original poster just wants to organise things
consistently, something like an e-mail might be better. For example:

----
Title: The Art of Unix Programming
URL: http://www.catb.org/~esr/writings/taoup/html
Keywords: Unix, philosophy

Eric Raymond discusses some of the Unix traditions and mindset. He shows
where and why it has been successful, and gives good advice on how to
work with the Unix world-view.

His chapter on designing Unix file formats is well worth reading. Quote:
"The most serious problem with XML is that it doesn't play well with
traditional Unix tools. Software that wants to read an XML format needs
an XML parser; this means bulky, complicated programs. Also, XML is
itself rather bulky; it can be difficult to see the data amidst all the
markup."
(http://www.catb.org/~esr/writings/taoup/html/ch05s02.html)

----

I know you're advising a simplified ML format, but it seems to me that
you might as well go for XML (and get the benefit of XML programs, which
will be overkill for the original poster), or go for something simple
that works well with Unix line-oriented tools (grep and cut, in
particular).

In any case, the original poster will not be learning a simple (and
limited) database application, but the Unix shell: a *much* more
worthwhile skill.

(I'd also note that filesystems are becoming much more like databases:
you can seriously call this a free-text non-relational database).

James.

-- 
E-mail address: james@ |    "Just for once, I wish we would encounter an
westexe.demon.co.uk    | alien menace that wasn't immune to bullets..."
                       |     -- The Brigadier, 'Doctor Who'





More information about the users mailing list