Skip to content

Hello iPhone …and hello extraneous iCal notes?!

In my usual late-adopter fashion, I only recently made the move to an iPhone 3G from a Palm Treo 650. (The change was precipitated by worry over more frequent Treo crashes, chronic dissatisfaction with syncing, and a growing annoyance with Verizon’s website —rather than from Shiny Gadget Curiosity. Obviously, such Curiosity is now amply present!) Updating went well, as did a very fast sync.

Since I keep all too many calendar entries (a habit developed with my old Palm V in the late 1990s), I checked the entries in iCal. They had transferred over, after some brief redundancy, removal and restoration dances (i.e., import recent calendar-name.ics as a New Calendar, verify data, then remove older version of calendar). But, I confess I hadn’t bothered to check the entry details like time, repetition and notes.

Well, well, well. Those entry notes. If I had written a note, it was there. But whether or not I did, nearly all calendar entries had nonsensical strings inserted into the note field.

~Oh, joy~. Who was to blame? Palm? DateBk5? Or Missing Sync? Garden gnomes?

But there was a definite pattern: some variation of DESCRIPTION:##@@X@@@@@@@@@@@@@@, where X is a letter, followed by a carriage return. This covered the vast majority of those superfluous strings. An excellent candidate for cleanup with regular expressions!

The recipe involves exporting each calendar from iCal, editing them in either TextWrangler or Smultron for the regex support, then doing the reimport dance. (Although in my case, I had too many calendars from the multiple categories from DateBk5, so initially had to do some calendar merging.)

I made three different types of regular expressions, in the following order below, to find the troublesome strings. Then in three passes per calendar file, I replaced strings with nothing (empty string). The first one gets rid of notes containing only the extraneous string, whereas the third regex (which needs to be the last pass) doesn’t erase the entire note field if a legitimate one exists (because it still begins with DESCRIPTION:), but only removes the junk and preserves the real note. The second regex is similar to the first one (an entirely junk string), with an additional string of [Link-blah].

^DESCRIPTION:##.+@@@.+@\\n$\r

^DESCRIPTION:##.+@@@.+@\\n\[Link.+\]\\n$\r

##.+@@@.+@\\n

The caret (^) looks for DESCRIPTION:## at the beginning of the first two regexen. Then, since every instance of the extraneous string contains ## followed by one or two letters, plus at least three @-signs followed by \n, the phrase ##.+@@@.+@\\n neatly takes care of that portion! This Basic Syntax Reference sums up what each of those regex special characters do.

Now I need to somehow transfer my memos and lists, which means something better than the iPhone’s default Notes application. That’s gonna be a royal pain, since there’s currently no clear way to transfer Palm databases over to the iPhone. >:-|

2 comments

  1. Brent wrote:

    It was definitely DateBk5. Various times in my life as a Palm User, I migrated from one Palm to another, and sometimes, the attached notes that DateBk5 uses to provide special icons and formatting show up in Palm Desktop under the Memos section when they formerly seemed hidden. Those Memos looked exactly like you described.

    By the way, I’m in the process of migrating to iPhone now, and I figured out a brute-force way to migrate the notes from Palm Desktop to iPhone. You have to create notes in Mail, and then iPhone should sync with those notes as of iPhone OS 3.0. I haven’t done it yet, but I have written an Applescript that will automate (albeit one at a time), the process

    Friday, 17 July 2009 at 11:45 pm | Permalink
  2. sairuh wrote:

    Brent, thanks — that’s good to know about DateBk. Your plan sounds good for migrating via Note < -> Mail sync, too.

    Sunday, 19 July 2009 at 8:53 pm | Permalink

Submit a comment

Your email is never published or shared. Required fields are marked with a red diamond, .