Skip to content

How can i use the Export file? #8

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

Open
dipplabs opened this issue May 8, 2024 · 4 comments
Open

How can i use the Export file? #8

dipplabs opened this issue May 8, 2024 · 4 comments

Comments

@dipplabs
Copy link

dipplabs commented May 8, 2024

I am trying to clean up all my replacements bc i have a lot and some may be dups.

How can I use the export file, make the changes I need to make, and then import it back in?
The export file is very hard to read....

Does anyone have a PHP Script or something else that will allow me to export the export file into a format where it can be read in a .txt file or can someone help point me in the right direction on how to use the export file from TextFast so it's more readable.

I have a lot of text replacements that I may have dups of or may want to combine...

I tried to use XML/JSON sites to try and make it more readable but not sure if the export file is XML format.... What format is the export file? JSON or is the export file a different format?

It would be nice to have it exported into a .txt file that I can then use in an editor to make changes better instead of changing it in the plugin in the browser. Then I would need a way to import that file back into the plugin.

Does anyone have any ideas on the best way to do this other than just going through the entire plugin via the browser?

@tripleee
Copy link

The file is in JSON format. It is slightly broken because it includes a newline where you cannot have one when you import it back in.

For example, if you have

Shortcut Replacement
onex this is the first one
twox second one,
with a line break even

the exported JSON will look like

[{"replace": "onex\n", "with": "this is the first one"}, {"replace": "twox\n", "with": "second one,\nwith a line break even"}]

You can't directly import this back in because you will need "replace": "onex" without the final \n in order for the imported macros to work (and similarly for twox\n etc).

There are many tools to manage JSON files, try jq for a start, though many text editors will also provide helpful tooling for manipulating this format.

@tripleee
Copy link

I have created a PR #11 which attempts to remove the stray newline in the "replace" key. Perhaps the final newline in "with" should go away as well?

@dipplabs
Copy link
Author

dipplabs commented Jan 12, 2025 via email

@dipplabs
Copy link
Author

dipplabs commented Jan 12, 2025 via email

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

2 participants