Index

A.J.Wells home  >  Index

Index 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. Index is a 20k 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 .index in the users home directory, here data is stored in 2 text files for each database, one <name>.idx 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 (.idx) file.

When index 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 addesses. 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 ~/.index/<name>.idx, and as shown below you enter the required fields. In this example a database containing items of personal information is being created, with field names as shown.

image 002

Here you enter a field name followed by one or more RETs (until you have the number of lines required for the field entry upto 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 begining of that line.

Then save the file and exit the editor.

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

image 003

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).

image 004

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.

image 005

The find entry option filters with any text string (no wild cards), and is case sensitive (unless index 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:-

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

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

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

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

index -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 :-
index -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.
index -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.

Index source

Index binary i386

Index binary arm