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

Import/Export docs have no Import information #995

Closed
bjornasm opened this issue Jul 8, 2020 · 8 comments · Fixed by #1332
Closed

Import/Export docs have no Import information #995

bjornasm opened this issue Jul 8, 2020 · 8 comments · Fixed by #1332
Labels
documentation Improvements or additions to documentation 📌 This can't go stale

Comments

@bjornasm
Copy link

bjornasm commented Jul 8, 2020

Bug Report

Environment

Docs on jrnl.sh

Current Behavior

The docs header is import and export, however they don't show any example on import at all.

@bjornasm bjornasm added 🆕 New! bug Something isn't working labels Jul 8, 2020
@wren wren added documentation Improvements or additions to documentation and removed bug Something isn't working labels Jul 9, 2020
@wren
Copy link
Member

wren commented Jul 9, 2020

Yup, this is absolutely right. The page referenced is here: https://jrnl.sh/export/

Here's some notes for what needs to go into this section if anyone feels like sending over a PR:

  • jrnl firstjournal --export text | jrnl secondjournal --import lets you import from one journal to another.
  • You can also use any filters like you would normally, like jrnl -4 -contains "some text" -starred --export text | jrnl secondjournal --import.
  • Just like the rest of journal, specifying the journal is optional, and will use the journal default if one isn't given. So, jrnl --export text | jrnl secondjournal --import sends entries from journal default to journal secondjournal.
  • You can import directly from a file using the -i flag like jrnl --import -i somefile.txt. You can use this if you don't want to pipe the data to jrnl as shown above.
  • --import technically supports importer plugins, but the only one we ship with is for the default jrnl format (which is equivalent of --import jrnl, but we default to jrnl since only one exists, by default). Some plugins might exist out there, but I haven't taken the time to look for any (please comment if you know of some).

@wren wren removed documentation Improvements or additions to documentation 🆕 New! labels Jul 11, 2020
@wren wren added the documentation Improvements or additions to documentation label Aug 18, 2020
@xeruf
Copy link
Contributor

xeruf commented Oct 9, 2020

Hey, I have some text where I lost the original file, I only got the default jrnl output (with dates not in brackets and multilines using pipe) - it doesn't seem to pick that up correctly?

@wren
Copy link
Member

wren commented Oct 10, 2020

@xerus2000 The default output is the "pretty" format, and is really only meant for display purposes (it has color codes, etc, that make parsing impractical). We can probably do some shell magic to fix up the pretty format to make it importable. Can you paste an example entry with the date format you use here so I can help?

@xeruf
Copy link
Contributor

xeruf commented Oct 13, 2020

I fixed it manually with vim ;) but since it's not much different, it shouldn't be hard to also allow importing that automatically?

@stale
Copy link

stale bot commented Dec 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Inactive issue: will be closed soon if no activity label Dec 12, 2020
@wren wren added the 📌 This can't go stale label Dec 12, 2020
@stale stale bot removed the stale Inactive issue: will be closed soon if no activity label Dec 12, 2020
@micahellison
Copy link
Member

micahellison commented Jun 5, 2021

I was just playing around with this today while checking out #1256, and found that --import doesn't import any entries that already exist in the target journal (using date, title, AND body to determine duplicates). Just wanted to point that out for when we get around to documenting this feature more fully.

@viegasfh
Copy link
Contributor

viegasfh commented Jul 5, 2021

I have given a try to this import feature, and it doesn't work for other journals, only the default one.

$ jrnl personal --import -i workspace/jrnl/journal.txt
[13 imported to default journal]

It always gets imported to the default journal and not the one I am pointing out, which should be personal in this case.

@micahellison
Copy link
Member

I have given a try to this import feature, and it doesn't work for other journals, only the default one.

$ jrnl personal --import -i workspace/jrnl/journal.txt
[13 imported to default journal]

It always gets imported to the default journal and not the one I am pointing out, which should be personal in this case.

It does work on non-default journals, but it doesn't work on directory journals. We have a bug filed for this in #999.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation 📌 This can't go stale
Projects
None yet
5 participants