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

Convert CSV inline #2

Open
pgbezerra opened this issue Aug 21, 2020 · 7 comments
Open

Convert CSV inline #2

pgbezerra opened this issue Aug 21, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@pgbezerra
Copy link

Hello, first of all, thank you for your time. This tool is realy good to me and saved my time a lot!

I saw some gaps when we are converting files directly instead of inline convertion:

  • Manipulate CSV without a file saved, just for temporary manipulation
  • Edit file, not save and then convert it, only saved changes will be converted

I think that we should convert inline but keep file convertion in a separated endpoint.
Or if there is a CSV file stored in hard drive, ask to user what he wants.

What do you think?

@Chukwuamaka
Copy link
Owner

Chukwuamaka commented Aug 25, 2020

Hello @Paulobezerr.

I am glad you enjoyed using the tool.

Let's ensure we are on the same page here. If I get you correctly, you are suggesting that the conversion should be done directly in the file being converted and no new file should be created.

If that's the case, then the reason I decided not to adopt that option was because I did not want users to lose the contents of the old document due to the conversion. It could be disheartening, especially if the user is not aware that the conversion replaced the previous contents and a Ctrl or Cmd+Z isn't possible. I had the same experience while using a similar tool. What do you think?

Giving users the ability to choose how they want the new content presented is something I'll consider, though.

@Chukwuamaka
Copy link
Owner

Also, I didn't really understand your second bullet point. Could you clarify what you meant?

Likewise, responding to your first suggestion in the concluding paragraph, I don't think it's possible to do an inline conversion and keep the converted file in a separate endpoint. Correct me if I'm wrong, but I think the only way to keep the converted file in a separate endpoint is by creating a new file. If what you suggest is possible, though, I'm open to ideas on how it can be achieved.

@Chukwuamaka Chukwuamaka added the enhancement New feature or request label Aug 25, 2020
@pgbezerra
Copy link
Author

pgbezerra commented Aug 26, 2020

Thank you for you answer!

Probably I did not splain well.

Two functionalities

I have said two endpoints.
I meant two Ctrl+Shift+P commands and two different keybindings.

Convert CSV file to JSON file

It is the way csvtojson-converter already did.

Advantages

  • Big files will be converted well
  • A JSON file created in current directory to do whatever you want

Disvantages:

  • You must have a CSV file on your storage
  • You have no choice to not create a JSON file output
  • You don't have a Ctrl+Z short cut to delete created output file

Convert CSV content to JSON

Doesn't matter if there is a saved file or a buffer only tab.
Your content will be converted propertly.
On this convertion way no file will be created nor modified, just JSON content writed down on tabs buffer.

Advantages

  • You don't have to create a CSV file, you can past CSV content and quickly convert it to JSON inline
  • If you don't want a new JSON file, you don't have to create it
  • Ctrl+Z

Disvantages

  • Big content can be a problem

@Chukwuamaka
Copy link
Owner

Chukwuamaka commented Aug 26, 2020

Thanks for clarifying your point.

If I get you correctly, in addition to the current functionalities, you want users to:

  • have the ability to do something like highlight/select a piece of text/content and perform the conversion on it, even if the containing file is not a CSV file;
  • choose whether they want to save the converted content in a new file or just replace the old content.

Please confirm that what I highlighted is what you are implying.

@pgbezerra
Copy link
Author

Yes, that exactly my idea!

@Chukwuamaka
Copy link
Owner

Thanks for the feedback. I'll close this issue when your suggestion is implemented.

If you'd love to, you are welcome to work on it.

@pgbezerra
Copy link
Author

As soon as I get time, I'll start.
Thank you @Chukwuamaka !

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

No branches or pull requests

2 participants