After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679791 - Import Template for importing CSV files
Import Template for importing CSV files
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Import - CSV
2.4.x
Other All
: Normal enhancement
: ---
Assigned To: gnucash-import-maint
gnucash-import-maint
: 683421 740030 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-07-12 11:19 UTC by richdthomas
Modified: 2018-06-29 23:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This patch resets the settings widgets (6.55 KB, patch)
2014-10-20 09:13 UTC, Bob
accepted-commit_now Details | Review
This patch adds the option to save and load settings (57.03 KB, patch)
2014-10-20 09:18 UTC, Bob
needs-work Details | Review
This patch resets the settings widgets (6.61 KB, patch)
2014-11-19 11:27 UTC, Bob
committed Details | Review
This patch adds the option to save and load settings (128.40 KB, patch)
2014-11-19 11:31 UTC, Bob
committed Details | Review

Description richdthomas 2012-07-12 11:19:25 UTC
Currently, the CSV import process for GNUCash is quite a manual process.

As I intend to regularly import CSV files to perform reconciliation, I would like to suggest an enhancement that reduces the amount of manual work required on each import.

At the moment, each time I do an CSV import, I have to select the date format, as well as each column - Transaction Date, Num, Description, Withdrawal, Deposit, Balance.

Please could GNUCash be enhanced, so that a pre-determined template can be created with the date format and field locations in it.  Then this template can be selected each time an import is done and then moves on to the next stage of the import process.

Thanks in advance,

Richard.
Comment 1 Arian@sanusi.de 2014-09-15 16:14:24 UTC
I am also missing this feature - giving this a little push. Would be great if someone could implement this!
Comment 2 Bob 2014-10-20 09:13:30 UTC
Created attachment 288898 [details] [review]
This patch resets the settings widgets

Whilst looking at this, I noticed that if you went back from the setting page after you had changed some settings to the file page and then forward again the settings were still as you left them.

This patch reset the settings widgets to there defaults when doing above and also a couple of potential memory leaks on the file page.
Comment 3 Bob 2014-10-20 09:18:30 UTC
Created attachment 288901 [details] [review]
This patch adds the option to save and load settings

This patch adds the option to save and load settings whilst doing a CSV transaction import. Some text may need changing but as far as I can tell it achieves the objectives.

The settings are stored to the state file, I am not sure if this is correct, I can not think of a reason not to but I may be missing some thing.

Bob
Comment 4 Mike Evans 2014-10-21 08:47:08 UTC
*** Bug 683421 has been marked as a duplicate of this bug. ***
Comment 5 Geert Janssens 2014-11-12 18:28:59 UTC
Comment on attachment 288901 [details] [review]
This patch adds the option to save and load settings

Thank you for your patches. I have tested them and the
work rather well.

Here are my remarks:
1. General remark: please add a reference to the bug in your commit messages.
   That makes it easier to link a commit to a bug afterwards. My preferred way
   of doing so is to use the bug summary as subject line:
   Bug 679791 - Import Template for importing CSV files
   optionally followed by ' - part 1', '- part2', ... depending on how many
   commits are on the bug. I'm also fine however with mentioning the bug
   in the body of the commit message in some way.
2. It looks like the last line to process is not saved, although on retrospect
   that's probably intentional ?
3. For me it would make more sense to have the preset dropdown on the
   column configuration page instead of once on the first page and once on
   the last page. Then when the user reaches the column configuration page,
   he can simply select the desired preset there. Add the delete and save
   functionality in there as well already. That way there's only one page
   to deal with all aspects of column configuration, including managing presets.
   The only tricky part would be to handle a cancel on the assistant if the user
   had saved a preset during this run. Personally I'm fine with keeping that
   preset in the state file anyway. The user can remove it if needed in a
   future import run.

What do you think ?
Comment 6 Bob 2014-11-14 09:51:20 UTC
Thanks for looking at them.
1) Have done this in the past, need to add this to my check list.

2) It was intentional, I was thinking that the total number of lines would change per import but have realised that I should be saving the number of lines to skip, not the line number so will add this.

3) I thought the way it is set now would flow better and if the import was successful they could save the settings. But this way may be too far removed from the configuration page so will try changing it to the way you suggest with the options at the top of the page.
Comment 7 Bob 2014-11-19 11:27:51 UTC
Created attachment 290972 [details] [review]
This patch resets the settings widgets

Same patch as before but with bug reference.
Comment 8 Bob 2014-11-19 11:31:15 UTC
Created attachment 290973 [details] [review]
This patch adds the option to save and load settings

This patch adds the bug reference and also moves the settings combo to the preview page. The glade file has a lot of changes as I have used a couple of frames to separate items.
Comment 9 Geert Janssens 2014-11-29 18:47:15 UTC
Thanks for the update. The bug reference is now in the commit message
which is good. Remind me again: how do you push your commits to bugzilla ?
I'm asking because your tool tends to squash the whole commit message in
the subject of the mail, eliminating all newlines.
(That's just a detail though)

More importantly when I try to build gnucash with your patch I get
the following build errors:

/kobaltnet/janssege/Development/gnucash/gnucash/src/import-export/csv-imp/gnc-csv-trans-settings.c: In function 'gnc_csv_trans_save_settings':
/kobaltnet/janssege/Development/gnucash/gnucash/src/import-export/csv-imp/gnc-csv-trans-settings.c:295:9: error: too few arguments to function 'guid_new'
         settings_guid = guid_new ();
         ^
In file included from /kobaltnet/janssege/Development/gnucash/gnucash/src/libqof/qof/qofid.h:77:0,
                 from /kobaltnet/janssege/Development/gnucash/gnucash/src/libqof/qof/qof.h:76,
                 from /kobaltnet/janssege/Development/gnucash/gnucash/src/app-utils/gnc-state.h:55,
                 from /kobaltnet/janssege/Development/gnucash/gnucash/src/import-export/csv-imp/gnc-csv-trans-settings.c:32:
/kobaltnet/janssege/Development/gnucash/gnucash/src/libqof/qof/guid.h:103:6: note: declared here
 void guid_new(GncGUID *guid);
      ^
/kobaltnet/janssege/Development/gnucash/gnucash/src/import-export/csv-imp/gnc-csv-trans-settings.c:296:21: error: assignment discards 'const' qualifier from pointer target type [-Werror]
         string_guid = guid_to_string (settings_guid);

Can you correct these ?
Comment 10 Geert Janssens 2014-11-29 18:52:58 UTC
*** Bug 740030 has been marked as a duplicate of this bug. ***
Comment 11 Bob 2014-11-30 10:45:01 UTC
Geert,

I think there is something wrong with your setup. guid_new is defined on line 105 as GncGUID * guid_new (void); in my local guid.h file and also on git.

As for commit message, I have been trying gitg.

Bob
Comment 12 Bob 2014-11-30 10:58:14 UTC
Having another look I think you tested this against maint when it should of been against master.
Comment 13 Geert Janssens 2014-11-30 14:36:18 UTC
Ah, that was it. I have been processing several patches in a row and mixed up branches in the process.

On master your patch works perfectly. Thank you very much.
Comment 14 John Ralls 2017-09-24 22:42:31 UTC
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
Comment 15 John Ralls 2018-06-29 23:09:28 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=679791. Please update any external references or bookmarks.