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

Data import directly from paste buffer #2909

Closed
philrz opened this issue Nov 27, 2023 · 1 comment · Fixed by #2928
Closed

Data import directly from paste buffer #2909

philrz opened this issue Nov 27, 2023 · 1 comment · Fixed by #2928

Comments

@philrz
Copy link
Contributor

philrz commented Nov 27, 2023

tl;dr

Particularly with the coming support for TSV format, Zui users would benefit from being able to import data directly from their paste buffer.

Details

At the time of the filing of this issue, Zui is at commit 3a66931.

brimdata/super#4891 will soon bring support to Zed for easily reading TSV data. Once that lands I intend to add TSV to the list of import/export formats in Zui (#2908).

Zui users that have asked for TSV support have primarily been users of Excel or Google Sheets that have pointed out when doing cut & paste from these apps the data in the paste buffer is of TSV format. The attached format shows where things are headed at the Zed layer using the branch from brimdata/super#4891.

Demo.mp4

As this shows, it'll now be easy to read this TSV data, but the user needs to take the extra step if pasting it into a file. Such a file could be easily dragged into Zui, but even better would be if they could skip the file altogether and go directly from the paste buffer into Zui. I'm hopeful that this will flow nicely with the new Preview & Load experience, i.e., instead of having the zq take its input from files on a command line, just give it a stdin stream of what's in the paste buffer.

In terms of how to invoke this, I'm not yet certain. My first thought was to add another pull-down menu item similar to the Open Data File... (e.g., "Open From Paste Buffer"?) @jameskerr also wondered about taking over the Paste option that's in the Edit menu, which does seem like it would be possible in contexts where it's not already claimed for something else (e.g., when the Editor is active).

This was referenced Dec 6, 2023
@philrz
Copy link
Contributor Author

philrz commented Dec 20, 2023

Verified in Zui commit 535f6e9.

As shown in the attached video, data in the paste buffer (such as TSV from Google Sheets) can now be imported directly into Zui using the File > Paste Data... option from the pull-down menu or corresponding hot key (e.g., shift-command-v on macOS). Once pasted, it becomes input data that can be shaped in Preview & Load just like files dragged into the app. Multiple pastes are possible as well as mixing pastes with file inputs. Another nice trick shown is that this makes it easy to import simple text from the paste buffer if the Data Format option is for Line is selected.

Verify.mp4

Thanks @jameskerr!

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

Successfully merging a pull request may close this issue.

1 participant