Attobase

A flatfile text database for Linux/Unix

Attobase is a text, flat-file database manager. It is used to enter and store information which can then be very simply filtered and retrieved. Being broadly similar to Psion’s own EPOC / SIBO program “Data”, it is quite suitable as a console Personal Information Manager for Linux running on the Psion 5mx. Attobase is a 30k binary which can be placed in /usr/local/bin or /usr/bin (whatever is in your path statement in profile). It requires ncurses (which is normally already included in a distribution). It requires an editor setting in /etc/profile (eg. For the editor nano add the line export EDITOR=”nano” Similarly for your editor of choice).

It requires a hidden directory .attobase in the users home directory, here data is stored in 2 text files for each database, one <name>.atx for the field names and one <name>.db for the field data entries. A database maximum size limit is determined by memory available. A maximum of 64 database files can be stored, each with upto 16 field entry lines as defined in its own (.atx) file.

When attobase is run, it prompts you to

Select a database:

You can type the name of a data base already listed (if you have made any), or you can enter the name of a new one you would like to create.

If you type in an existing database name you are put straight to the main menu for this database.

If you type a new one you are presented with the following response:

You will now be placed into an editor so that you can create the database description
file. This file will be used by the program to prompt you for new items to be inserted
into the database.

Each line in this file is the name of a field.  It may be as long as you want, and may
contain spaces.  The order of the lines in the file is the order you will be prompted
for new information when inserting into the database. You may leave blank lines in the
file; this allows multiple-line entries for items such as addresses. You may have a
total of 16 lines in the file.

By default, all lines in an entry will be examined when searching for a pattern. To
make the program ignore a line, start that line with an exclamation point (!).
The database is always sorted into ASCII collating sequence based on the contents of
the first field. When you are finished, save the file and exit the editor. You will
then be placed in the main menu, where you can select other operations on the
database.

On pressing RET you are taken to whatever editor is selected in /etc/profile (in this case pico) to edit the file ~/.attobase/<name>.atx. Here you enter a field name followed by one or more RETs (until you have the number of lines required for the field entry up to a maximum of 16 lines per data entry page). Then the next field and so on until you are done. If you do not want a field to be included when a string search is performed (menu item f below) then place an exclamation mark (!) at the beginning of that line.

Then save the file and exit the editor.

You are then presented with the main menu which is self explanatory.

Pressing a will allow you to add one database entry. Press RET after completion of one line of information to move down to the next line (do not use arrow keys).

Press ESC when you are done and at the prompt press y to save the entry.

Following completion of data entries to the field the s or q option can be selected in the main menu to in order that database changes are saved.

The data retrieval menu is shown here following the selection of option f at the main menu and successfully retrieving an entry.

The find entry option filters with any text string (no wild cards), and is case sensitive (unless attobase is run using the -i argument  (case ignored). 

If more than one database entry is found matching a string search, then the first entry is displayed and the others can then be viewed each in turn by pressing return, to put you back to the main menu after the last entry.

Other menu items are self explanatory apart from editing. Here, data can be edited as follows :-

cntl + f   moves the cursor forward                

cntl + b  moves the cursor backward

cntl + d  deletes the character

cntl + h   backspace

cntl + a   moves cursor to beginning of line

cntl + e   moves cursor to end of line

cntl + k   deletes all from cursor to end of line

cntl + n   moves cursor to the next line

cntl + p   moves cursor to the previous line

cntl + l    refreshes the screen

RET  moves the cursor to the next  field

Pressing any keys other than text characters, symbols or return, escapes to the prompt for saving the entry.

To return to your database to add / edit / delete / search records you can type:-

attobase   To be presented with a list of all databases you have created. Type <databasename>  to enter.

attobase  <databasename>   To directly enter a database you know is present.

attobase -i    To perform the same as above but ignore case in searches.

attobase -a   To include all fields in a search (forces over the exclamation mark flag at the beginning of a field line).

attobase -f   This is specified with the name of a filter, then when a database name and pattern are also given, all matching entries will be sent through the filter program instead of to the standard output.The first line of output will contain the field names for the database, separated by tabs. Each following line will contain one database entry, with fields separated by tabs. This format is easily dealt with using programs such as awk.  Two examples are :-
attobase -f more <databasename> abc will display to screen tabulated data of entries containing the string “abc” with each column being a field, with the field names as column headings. The filter more pages the retrieved data one page at a time by pressing the space bar.
attobase -f cat > file1.txt <databasename> abc will write to a file called file1.txt, the tabulated data entries containing the string “abc” with each column being a field, with the field names as column headings.

Thats It.

I can’t put attobase up to sourceforge for download as it is not under the GPL licence yet however If you would like to try it please contact me mail@ajwells.net I can send you the i386 binary, the ARM binary and the source code.

%d bloggers like this: