--- src/import-export/import-account-matcher.c.orig	2013-07-13 20:53:16.000000000 -0700
+++ src/import-export/import-account-matcher.c	2013-07-13 20:53:52.000000000 -0700
@@ -170,7 +170,7 @@
     picker->new_account_default_commodity = new_account_default_commodity;
     picker->new_account_default_type = new_account_default_type;
 
-    /*DEBUG("Looking for account with online_id: %s", account_online_id_value);*/
+    /*DEBUG("Looking for account with online_id: \"%s\"", account_online_id_value);*/
     if (account_online_id_value != NULL)
     {
         retval =
@@ -179,6 +179,21 @@
                     /* This argument will only be
                     					  used as a "const char*" */
                     (void*)account_online_id_value);
+
+	/* BEGIN: try again without extra space at the end */
+	if ((retval == NULL) && g_str_has_suffix(account_online_id_value, " "))
+	{
+	    gchar *trimmed = g_strndup(account_online_id_value, strlen(account_online_id_value) - 1);
+	    if (trimmed)
+	    {
+		retval = gnc_account_foreach_descendant_until(
+		    gnc_get_current_root_account (),
+		    test_acct_online_id_match,
+		    (void *)trimmed);
+		g_free(trimmed);
+	    }
+	}
+	/* END: try again without extra space at the end */
     }
     if (retval == NULL && auto_create != 0)
     {
