GNOME Bugzilla – Bug 679791
Import Template for importing CSV files
Last modified: 2018-06-29 23:09:28 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.
I am also missing this feature - giving this a little push. Would be great if someone could implement this!
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.
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
*** Bug 683421 has been marked as a duplicate of this bug. ***
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 ?
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.
Created attachment 290972 [details] [review] This patch resets the settings widgets Same patch as before but with bug reference.
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.
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 ?
*** Bug 740030 has been marked as a duplicate of this bug. ***
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
Having another look I think you tested this against maint when it should of been against master.
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.
Reassign version to 2.4.x so that individual 2.4 versions can be retired.
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.