How to export data from the 100LX and 200LX databases (phone, Notetaker,
Database)
January 29, 1999
Alan Striegel

Every couple of weeks, the question comes up on the news groups of how to
move data out of an HPLX's phonebook or other databases to some other
form of handheld organizer or PC companion like the Palm or WinCE
machines (or even desktop programs like Microsoft Outlook).  This is
intended to help answer those questions.

Every one of these new systems can use CSV files to import data; you just
need a way to create it from your database.

The key feature is that the Smart Clips can be used for custom print
forms and you can print the entire database to a file.  Defining a Smart
Clip to build a CSV (comma-separated values) file is very easy.

When the database is open, the <F5> key lets you work with Smart Clips.
Define a new one that starts with the quote character <">, then press the
<F2> key to add the first field for your export.  Follow that with
another quote <">, a comma <,>, and another quote <"> before you insert
the next field.  Repeat this until all the necessary fields are
represented.

It should look something like this in the Define Smart Clip screen:

">Name<",">Business<",">Home<"

It's important to try to fit everything on one line, since most import
programs take the start of a new line as the beginning of the next 
record.*

When all your fields are represented, give this new Smart Clip a name you
can identify, like "All fields CSV" and return to the main screen
displaying the database you want to export.

Use the <MENU>/File/Print command sequence and choose All Items under
"Print", Custom under "Style" and use the <TAB> key to move the cursor into
the box underneath.  Here you use the down arrow key to select the name
of the Smart Clip you created.  Move on to the "Print to" area and select
File, then press the <F10> key for "OK".  You will be prompted for a
filename and at this point you can name the file with a .CSV extension.

Remember that for large databases, this operation can take some time, so
be patient.  If you're operating on batteries, you may be able to  speed
things up a bit by holding down the shift key (this disables light sleep
mode).

It's up to you how you transfer this file to another machine, but that's
pretty much all there is to it.  

See the HP 200LX User's Guide for the sections on: 
"printing using Smart Clips" (p. 380)
"To define your own Smart Clip" (p. 41)
===

* What do you do when you have too many fields to fit on one line?

Very good point!  This is an area worth addressing with some additional
detail.

A maximum of 220 characters can be put on a single line of the Smart Clip
Definition before it wraps around and starts a new line.  Since the
Definition controls the appearance of the output, a new line in the Smart
Clip Definition would create a carriage return character in the .CSV file
and that is interpreted as the end of the record.  The size of the
fields' contents almost never matches the length of the field name.  So
if your database contains lots of long field names, even if they have
narrow contents, you will need to stop adding fields for output when
you reach this limit.

I have run into this issue on occasion and had to create another .CSV
file to merge with the data from the first.  It's important to include at
least one field in common between these Definitions.  That field should
contain unique, non-blank data for every record on which to key, so that
the records can be lined up when they are merged.

If your database contains lots of short field names with wide contents,
you may run into other limits. I haven't explored that side enough to
know.

