
JFile Converter - version 2.0

***************************************************************************
NOTE: Version 2.0 ONLY works with JFile version 2.0 or later databases!
***************************************************************************

This is rough cut at a JFile 2.0 <-> comma seperated values
import/export program.  It's a DOS command line application.

A sample comma seperated values file is included for example purposes.

***************************************************************************
Using the converter program:
***************************************************************************

The converter is can be fully command line driven or else you can
use it in interactive mode by simply running the jconv.exe program.

Command Line usage examples:

For csv->Jfile use: 
jconv.exe 1 <input_file> <output_file> <database_name> <optional_info_file> 

Where:
<input_file> is the path and DOS filename of the .csv to convert
	examples: c:\temp\test.csv   or    test.csv
<output_file> is the path and DOS filename of the .pdb file to create
	examples: c:\temp\test.pdb   or    test.pdb
<database_name> is the name of the database that will appear on the Pilot
	examples: TestDB    or TestDatabase
<optional_info_file> is optional parameter, if you have an seperate
	'information' file saved for the this database.
	examples: c:\temp\test.ifo   or   test.ifo

For JFile->csv use: 
jconv.exe 2 <input_file> <output_file> <optional_info_file>

<input_file> is the path and DOS filename of the .pdb to convert
	examples: c:\temp\test.csv   or    test.csv
<output_file> is the path and DOS filename of the .csv file to create
	examples: c:\temp\test.pdb   or    test.pdb
<optional_info_file> is optional parameter, if you would like to create
	an 'info' file containing formatting and such from the database
	examples: c:\temp\test.ifo   or   test.ifo

***************************************************************************
Example Usage
***************************************************************************

Let's say you have a JFile .pdb file that you want to convert to .csv.
The file is called cds.pdb.  The call to convert this is one of the
following:

jconv.exe 2 cds.pdb cds.csv

or if you want to have the option info file created:

jconv.exe 2 cds.pdb cds.csv cds.ifo

The cds.ifo file that is created is useful if you should change the 
content of the .csv file and wish to keep as much of the other formatting
and field type information still intact when converting back to .pdb.  The
format for the .ifo file is described below.

****************************

Now lets say in the reverse situation, you have a .csv file to convert to .pdb.
The .csv file is again called cds.csv, you'd use one of two methods:

jconv.exe 1 cds.csv cds.pdb CDs

or if you have a previously saved .ifo file to go with this database:

jconv.exe 1 cds.csv cds.pdb CDs cds.ifo 

The resulting .pdb file can then be installed in your Pilot just like
any other .prc or .pdb file using the InstallApp program.

*****************************

Your JFile .pdb's should be backed up in your Pilot/<username>/backup directory.
If they are not, it is likely you have the older HotSync 1.0 which has a bug in
that it only backs up a few non-ROM based app's databases - to correct this
problem you need to upgrade to HotSync 1.1 or later or the Generic Conduit
Manager from Pat Beirne.  

NOTE: Converters that worked for version 1.6b and prior versions of JFile
will NOT work correctly for version 2.0 and later of JFile.  As other
third party JFile .pdb converters become available, be sure that the 
program you are using to convert is for JFile 2.0 or later.

***************************************************************************
The format for the .csv file is:
***************************************************************************

- top line is the field names, each seperated by a comma
- each following line is a record, each field seperated by a comma

The fields may be enclosed in quotes which will be removed prior to
conversion to JFile .pdb format.

Be sure to follow this format, as there is only minimal error checking of
the file being done at this point.  

***************************************************************************
The format for the optional_info file is:
***************************************************************************

The following explanation may be a bit complex to read through at first,
but by looking at an example when you convert from .pdb to .csv WITH 
an info file, you can see how it all works together.  

There is also no requirement to use or to ever modify the info file you
create.  See the example usage section to see how it is used for more
general purposes.

First Line:

contains a number representing the type for each field
NOTE: there must be 1 number for each field on this line
and that the last field should not be a boolean field

types are as follows:

 1 = string
 2 = boolean
 4 = date
 8 = int
16 = float
32 = time
64 = popup list

example: for a database with 7 fields, of type: string, boolean, date,
popup list, int, float, popup list in that order would look like:

1 2 4 64 8 16 64 

Second Line:

contains the width of each field when displaying in the columnal overall
database view, must be 0-160, and contain one number for each field.

example: for a database with 7 fields each of width 80:

80 80 80 80 80 80 80 

Third Line:

contains the width of the 'data' field (in pixels) for the editing
view of the database (should be in the 20 to 140 range)

example: for a database with a data width of 90 pixel:

90 

Fourth Line:

contains which column is displayed next to the 'non-movable' first 
column in the database view (range of 1 to 19 - 0 = first field, 1 = 
second field, etc)


example: to display the second field as the first movable column (this 
is the normal beginning view):

1


Fifth Line:

contains a the word 'none' (without quotes) if no password, or a password 
if desired (10 characters maximum) 


Sixth Line:

contains a 1 if the database has its 'auto-lock on app exit' on, or a 0
if it does not have this feature activated

example:

the database does not have its 'auto-lock' on app exit on:

0

Seventh Lines and on...

contains the entries in the popup lists, each item goes on a line
of its own.  List are prefixed with the string "popupX" where X is the
letter of the alphabet corresponding to the field number of the
associated popup list (ie. a = 1, b = 2, etc...)

example: 

the following lines are an example with a popup list for field 'd' which
is the 4th field, and a popup list for field 'g' which is 7th popup field

popupd
a
bb
cc
and
here
we are
popupg
1
11
33333
4444

Be sure to follow this format if you are creating or modifying such info files
manually instead of letting the jconv.exe program handle them, as there is only 
minimal error checking of the file being done at this point.  


