HOME Software Lotus Cars DWARF Kindle Solar
graphic with lotus elise and lotus elan

Palm Conversion Hint

Palm Conversions

Now we have two conversions. The first is Windows Palm database to Palm for Mac. The second is Palm for Mac tab&return format to Windows Outlook comma-separated-value format.

Initially we used the first and for a long time used the Palm app on Mac OSX (details on that follow). Then we decided to move to Sunbird, an open-source calendaring system that run on OSX and Linux (and possibly Windows). It turns out that the simplest conversion for Palm-on-Mac was to generate tab&return output from Palm and convert that so it looks just like Windows Outlook exported it. That is, convert the Palm file to a comma-separated-values file (csv). Because both Sunbird and Google Calendar are quite happy to import that Outlook csv format.

Palm Conversion .dba to Mac

A Palm Calendar database is a bit tricky to move from Windows to MacOS X. The Windows version will only write a .dba extension format and that format is not documented. The Mac version won't read that format, but will read a tab-field-delimited, return-line-delimited text file. I've writtten a simple C program to translate simple .dba entries to text so they can be imported on Mac with the Palm app.

Download C code

To use this you need to be comfortable compiling a simple C program and running it. It's small enough that you can read it in a couple minutes and verify it's not going to harm anything, but only if you know the C programming language... It won't convert repeating items, it makes each item a single date. It's based on a simple observation of how the Windows ME version of the Palm desktop application writes the bytes of a .dba file, and there is no guarantee these details of the binary file will be the same across releases.

Comments at the beginning of the code explain how to compile and run it.

If you find the dates look strange (show as 1961 perhaps) then run it using the -s option (an example is in the comments in the code). The strange dates are because the palm machine and your new machine are different endianness (your palm machine was almost certainly an Intel x86 [little-endian] and your new machine might be Mac PowerPC [big-endian]). If that means nothing to you don't worry about it. Just be aware you should use -s if the dates look wrong when not using -s.

Scott Leighton got me started with his description of the .dba format, but that description did not match up sufficiently with the version I had on Windows ME. So I gave up and wrote a simple heuristic-based program in C without using more than a couple hints from his information.

Palm Conversion Mac to Sunbird

What follows is a small shell script. It's easily runnable on Mac OSX (in the Terminal utility) or in a Linux shell command window. (I confess, though, that I actually used the script on Linux, not Mac). What it does is to readin a file named "input" which was created by a Palm export. It processes that file into Windows Outlook csv format and finally writes a file named "tmp4.csv" which can be imported directly to Google Calendar or Sunbird. The script is certainly not perfect. Any dates in the 1990s will not be handled correctly. Events scheduled over several days won't show up perfectly. There are probably other faults too. Hope it is of some use nonetheless. It worked for our 3000 lines of calendar data.

Observation: the Palm output prints a year like 01 but Outlook prints years like 2001. So this script converts years to the longer form.

# Convert comma to space to avoid confusion
# Convert mac 'return' to 'newline'.
# The 3rd conversion was for a strange character in our Palm
#  output and won't cause any difficulty for you.
tr -," " "  < input  | tr "\r" "\n" | tr "\202" "C"  > tmp1
# Now we do the essential conversions: change tab to comma
# and convert " to -. The former avoids problems if there is
# tab in a data field, and the latter removes quote characters
# as those will conflict with Outlook usage.
tr "\t" "," <tmp1 | tr -- '"' '-'  >tmp2
# Now fix up years to be 4 digits.
sed -e 's/:[0-9][0-9]/&:00/g' -e 'sx/01x/2001x' -e 'sx/02x/2002x' -e 'sx/03x/200
3x' -e 'sx/04x/2004x' -e 'sx/05x/2005x' -e 'sx/06x/2006x' -e 'sx/07x/2007x' -e '
sx/08x/2008x' -e 'sx/09x/2009x' <tmp2 >tmp3

#The following creates an awk script we will use shortly.
cat <<\EOF >tmp.awk
BEGIN { FS = ","; }
  { printf "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"False\",\"False\",,,,,,,,,\"App
ointment\","loc",,\"Normal\",\"False\",\"Normal\",\"2\"\n", $1, $2, $4, $2, $5; 
} 

EOF

#emit the Outlook header
echo '"Subject","Start Date","Start Time","End Date","End Time","All day event",
"Reminder on/off","Reminder Date","Reminder Time","Meeting Organizer","Required 
Attendees","Optional Attendees","Meeting Resources","Billing Information","Categ
ories","Description","Location","Mileage","Priority","Private","Sensitivity","Sh
ow time as"' >tmp4
# Use the awk script to actually convert the data to Outlook csv format.
awk -f tmp.awk <tmp3  >>tmp4
# Finally, convert from Unix newline form to dos return/newline form
# the way Outlook would write things.
unix2dos <tmp4 >tmp4.csv
# Now tmp4.csv can be imported.

To actually use the above, copy and paste into a file. Lets name it quoteit.sh here. Then use Palm and write a tab&return format, name it "input". And put it into a Mac folder, perhaps /tmp Then run the script with the following command (type by hand).

cd /tmp
sh quoteit.sh

Now start up sunbird or Google Calendar and inport the file /tmp/tmp4.csv Google calendar does much better than Sunbird at reporting any problems in the import-file (tmp4.csv here). Sunbird either does nothing or shows a totally useless report if it thinks things are not in the right format.

One of the reasons we abandoned Sunbird was it was seemingly going to take forever (meaning hours) to import 3000 lines of calendar data. And with even 2000 entries starting Sunbird got very slow. Very slow. In contrast, Google Calendar imported it all in a minute or two, and starts up very quickly.

So if you have much calendar data don't expect Sunbird to be usable, at least as Sunbird exists in April 2007.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.