Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort CSV rows when exporting #11427

Open
ftrebien opened this issue Nov 2, 2024 · 3 comments
Open

Sort CSV rows when exporting #11427

ftrebien opened this issue Nov 2, 2024 · 3 comments
Assignees
Milestone

Comments

@ftrebien
Copy link

ftrebien commented Nov 2, 2024

Summary

When exporting to a CSV file, it would be helpful to allow entries to be exported in a natural sort order, ignoring the case. This should provide consistency across exports and make comparing databases easier.

Examples

Consider a database export with the following items in random order:

Group Title Username
Base/Work system B myuser3
Base/Work System A myuser11
Base/Work system A myuser2
Base/Home system C myuser4

With a natural sort order, the output would always be ordered by Group, then Title, then Username, and so on:

Group Title Username
Base/Home system C myuser4
Base/Work system A myuser2
Base/Work System A myuser11
Base/Work system B myuser3

Context

When items are in a random order, users need to manually sort each CSV file before comparing databases. Although an advanced merge feature is in development, there are some cases (such as comparing databases managed by different people) that may require manual resolution of the differences. For example, a user may choose to keep an older entry after learning a newer entry in another database is incorrect or poorly renamed, or they might prefer to resolve differences in various ways, such as assigning a more descriptive title, moving an entry to another group, or even splitting a conflicting entry into separate entries.

@droidmonkey
Copy link
Member

CSV export is done in "database order" which applies no explicit column sorting. Database order is typically based on when entries are added to groups but can be modified by moving entries up and down in the entry view. We are not going to apply any explicit sorting to CSV exports. If you want to sort, use a CSV viewing program to apply the sorting you desire and save the file.

PS- Using CSV to compare databases is an anti-pattern and wouldn't help you in a merge scenario anyway. If databases do not share a lineage with each other then entries are considered completely different from each other in a merge.

@ftrebien
Copy link
Author

ftrebien commented Nov 2, 2024

Thank you for taking the time to respond. While I understand KeepassXC’s focus on database order, treating groups like ordered lists, I personally manage my databases as unordered sets of entries, which I find more maintainable, especially on mobile and with larger datasets. Adding optional sorting for CSV exports could broaden the feature’s utility, as in the case I described. I’ll leave it for your future consideration.

@droidmonkey
Copy link
Member

I'll reopen this and tie it to implementation on an export wizard, similar to our new import wizard.

@droidmonkey droidmonkey reopened this Nov 2, 2024
@droidmonkey droidmonkey added this to the v2.8.0 milestone Nov 2, 2024
@droidmonkey droidmonkey self-assigned this Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants