Repository navigation
CSV Export - #758
CSV Export#758
Conversation
codinguser
left a comment
There was a problem hiding this comment.
Thanks for the PR. I made some comments where some changes might be necessary.
Also a few questions:
- Are these two CSV formats supported by GnuCash desktop? As far as I understand, there is support in the newer (unstable) and future 3.0 version for importing CSV. Please ensure that the CSV we generate can be consumed by the desktop version. See #756
- Is there any CSV format which supports both accounts and transactions in one file?
Cheers,
| names.add("To Rate/Price"); | ||
| names.add("From Rate/Price"); | ||
|
|
||
| List<Transaction> transactions = mTransactionsDbAdapter.getAllTransactions(); |
There was a problem hiding this comment.
The number of transactions in the database can be quite big for very large books over time. It is not efficient to load everything into memory. It is better to use a cursor to iterate over the database and retrieve the entries you need on-demand.
I know just getting all records is easier at first, but it will become technical debt in the future
There was a problem hiding this comment.
I'll try to fix it in 5-10 days. Now i have trouble because i have no big db. Can you help me and give some example of big enough book in xml? I need it to test export speed and compatibility with gnucash desktop
There was a problem hiding this comment.
Hmm, I do not have any big db. I've been thinking to write some modules in the test framework which generates tons of transactions. But I never got around to it.
No matter, I think you can just switch it to cursor iteration without having to actually have a big book to test it on. Users who have them will appreciate it.
| for(int i = 0; i < transactions.size(); i++) { | ||
| Transaction transaction = transactions.get(i); | ||
| List<Split> splits = transaction.getSplits(); | ||
| for (int j = 0; j < splits.size()/2; j++) { |
There was a problem hiding this comment.
This loops depends on the ordering of the splits in the list. Even if it might be the case at the moment, I would prefer it we did not depend on it. The logic here would change anyway when switching to cursor-based iteration. When modifying it, please do not rely on the ordering of the splits.
There was a problem hiding this comment.
I'll try to fix it in 5-10 days
| mExportFormat = ExportFormat.XML; | ||
| mExportWarningTextView.setText(R.string.export_warning_xml); | ||
| mExportDateLayout.setVisibility(View.GONE); | ||
| mExportSeparatorLayout.setVisibility(View.GONE); |
There was a problem hiding this comment.
The mExportSeparatorLayout does not seem to include the Separator label. If you open the app and switch to CSV and then back to XML, the label Separator is still visible.
| <item>QIF</item> | ||
| <item>OFX</item> | ||
| <item>XML</item> | ||
| <item>CSV-accounts</item> |
There was a problem hiding this comment.
The translation is handled by the CrowdIn platform. No need to do it in the translation files.
I should add this to the development guidelines.
There was a problem hiding this comment.
I'll try to fix it in 5-10 days
|
I'm reviewing the PR. |
|
Thanks for the updates. Sorry it took a while to review it.
Also, there were two questions from my first review which you didn't respond to yet
Thanks again! |
|
@sononio I made the changes to the separator label and merged. |
This fork adds csv export variant with separator choosing.
There are two variants of export:
There are three variants of separator: