r21252 - gnucash/trunk/src/plugins/bi_import - Changed 3rd import regexp to actually accept quotes on all fields, and 4rd to accept commas and quotes, as advertised in the UI.

Geert Janssens gjanssens at code.gnucash.org
Sun Sep 11 10:24:40 EDT 2011


Author: gjanssens
Date: 2011-09-11 10:24:40 -0400 (Sun, 11 Sep 2011)
New Revision: 21252
Trac: http://svn.gnucash.org/trac/changeset/21252

Modified:
   gnucash/trunk/src/plugins/bi_import/gui.c
Log:
Changed 3rd import regexp to actually accept quotes on all fields, and 4rd to accept commas and quotes, as advertised in the UI.

Modified: gnucash/trunk/src/plugins/bi_import/gui.c
===================================================================
--- gnucash/trunk/src/plugins/bi_import/gui.c	2011-09-11 14:24:31 UTC (rev 21251)
+++ gnucash/trunk/src/plugins/bi_import/gui.c	2011-09-11 14:24:40 UTC (rev 21252)
@@ -309,7 +309,7 @@
     BillImportGui *gui = data;
     if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
         return;
-    g_string_assign (gui->regexp, "^(?<id>[^!#+^;]*);(?<date_opened>[^;]*);(?<owner_id>[^;]*);(?<billing_id>[^;]*);?(?<notes>[^;]*);?(?<date>[^;]*);?(?<desc>[^;]*);?(?<action>[^;]*);?(?<account>[^;]*);?(?<quantity>[^;]*);?(?<price>[^;]*);?(?<disc_type>[^;]*);?(?<disc_how>[^;]*);?(?<discount>[^;]*);?(?<taxable>[^;]*);?(?<taxincluded>[^;]*);?(?<tax_table>[^;]*);(?<date_posted>[^;]*);(?<due_date>[^;]*);(?<account_posted>[^;]*);(?<memo_posted>[^;]*);(?<accu_splits>[^;]*)");
+    g_string_assign (gui->regexp, "^\"(?<id>[^!#+^\"]*)\";\"(?<date_opened>[^\"]*)\";\"(?<owner_id>[^\"]*)\";\"(?<billing_id>[^\"]*)\";\"?(?<notes>[^\"]*)\";\"?(?<date>[^\"]*)\";\"?(?<desc>[^\"]*)\";\"?(?<action>[^\"]*)\";\"?(?<account>[^\"]*)\";\"?(?<quantity>[^\"]*)\";\"?(?<price>[^\"]*)\";\"?(?<disc_type>[^\"]*)\";\"?(?<disc_how>[^\"]*)\";\"?(?<discount>[^\"]*)\";\"?(?<taxable>[^\"]*)\";\"?(?<taxincluded>[^\"]*)\";\"?(?<tax_table>[^\"]*)\";\"(?<date_posted>[^\"]*)\";\"(?<due_date>[^\"]*)\";\"(?<account_posted>[^\"]*)\";\"(?<memo_posted>[^\"]*)\";\"(?<accu_splits>[^\"]*)\"");
     gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui);
 }
 void gnc_bi_import_gui_option4_cb (GtkWidget *widget, gpointer data)
@@ -317,7 +317,7 @@
     BillImportGui *gui = data;
     if (!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget) ))
         return;
-    g_string_assign (gui->regexp, "^(?<id>[^!#+^;]*);(?<date_opened>[^;]*);(?<owner_id>[^;]*);(?<billing_id>[^;]*);?(?<notes>[^;]*);?(?<date>[^;]*);?(?<desc>[^;]*);?(?<action>[^;]*);?(?<account>[^;]*);?(?<quantity>[^;]*);?(?<price>[^;]*);?(?<disc_type>[^;]*);?(?<disc_how>[^;]*);?(?<discount>[^;]*);?(?<taxable>[^;]*);?(?<taxincluded>[^;]*);?(?<tax_table>[^;]*);(?<date_posted>[^;]*);(?<due_date>[^;]*);(?<account_posted>[^;]*);(?<memo_posted>[^;]*);(?<accu_splits>[^;]*)");
+    g_string_assign (gui->regexp, "^\"(?<id>[^!#+^\"]*)\",\"(?<date_opened>[^\"]*)\",\"(?<owner_id>[^\"]*)\",\"(?<billing_id>[^\"]*)\",\"?(?<notes>[^\"]*)\",\"?(?<date>[^\"]*)\",\"?(?<desc>[^\"]*)\",\"?(?<action>[^\"]*)\",\"?(?<account>[^\"]*)\",\"?(?<quantity>[^\"]*)\",\"?(?<price>[^\"]*)\",\"?(?<disc_type>[^\"]*)\",\"?(?<disc_how>[^\"]*)\",\"?(?<discount>[^\"]*)\",\"?(?<taxable>[^\"]*)\",\"?(?<taxincluded>[^\"]*)\",\"?(?<tax_table>[^\"]*)\",\"(?<date_posted>[^\"]*)\",\"(?<due_date>[^\"]*)\",\"(?<account_posted>[^\"]*)\",\"(?<memo_posted>[^\"]*)\",\"(?<accu_splits>[^\"]*)\"");
     gnc_bi_import_gui_filenameChanged_cb (gui->entryFilename, gui);
 }
 void gnc_bi_import_gui_option5_cb (GtkWidget *widget, gpointer data)



More information about the gnucash-changes mailing list