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

Merging two timesheets #188

Closed
richardazia opened this issue Oct 27, 2020 · 4 comments
Closed

Merging two timesheets #188

richardazia opened this issue Oct 27, 2020 · 4 comments

Comments

@richardazia
Copy link

I accidentally created two sheets with similar names. I would like to be able to merge them.

The command could be: t merge sheet 1a sheet 1
The expected behaviour: take the data from sheet 1a and place it in sheet 1. It would then delete sheet 1a as it is no longer needed.

Would anyone else find this useful?

@richardazia
Copy link
Author

I accidentally created two sheets with similar names. I would like to be able to merge them.

The command could be: t merge sheet 1a sheet 1
The expected behaviour: take the data from sheet 1a and place it in sheet 1. It would then delete sheet 1a as it is no longer needed.

Would anyone else find this useful?

I used SQLite studio 3.2.1 to fix the mistake.

@jerith666
Copy link

I usually use t edit --move to fix mistakes like this. It doesn't scale if the accidentally-created sheet ends up with more than a few entries though.

@richardazia
Copy link
Author

I just tried t edit --move both ways to see how it works. Next time I make such a mistake I will use this. Thanks.

@dechimp dechimp closed this as completed Oct 27, 2020
@samg
Copy link
Owner

samg commented Oct 27, 2020

There's also an example in the README of how to use the ids formatter to script this kind of move between sheets.

https://github.com/samg/timetrap#built-in-formatters

The ids formatter is provided to facilitate scripting within timetrap. It only
outputs numeric id for the entries. This is handy if you want to move all entries
from one sheet to another sheet. You could do something like this:

$ for id in `t display sheet1 -f ids`; do t edit --id $id --move sheet2; done
editing entry #36
editing entry #37
editing entry #44
editing entry #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants