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

Show and/or edit tabular data via the command line #79

Open
doekman opened this issue Jul 8, 2019 · 3 comments
Open

Show and/or edit tabular data via the command line #79

doekman opened this issue Jul 8, 2019 · 3 comments

Comments

@doekman
Copy link

doekman commented Jul 8, 2019

Imagine the command tt or tabletool with which you can view (cat users.csv | tt) or edit (tt ~/Downloads/data.csv) tabular data from the command-line.

The functionality should be similar too mate from TextMate (for implementation, see mate on GitHub). For those unfamiliar with the command, see this document.

This would fix one big problem on the command-line.

@fulldecent
Copy link
Collaborator

This is outside of the project scope statement, which is published at https://github.com/jakob/TableTool#mission--project-scope--contributing

Sounds cool and I will be interested to look if you create this modern, limited Visicalc project.

@weepy
Copy link

weepy commented May 7, 2020

I think he just means launching tt from the command line . That's what mate does.

@doekman
Copy link
Author

doekman commented May 7, 2020

That is correct. At the moment, I have this alias:

alias tt="open -b at.eggerapps.tabletool"

so I could open a file on the command line with tt filename.csv. However, there are some things that can't be done this way.

  1. the alias doesn't wait until the form has been closed
  2. can't directly use it with a pipe |
  3. set a window title (handy when using a pipe)
  4. select a line

Maybe with some advanced scripting this could be done with an external tool, but I think it might be useful for Table Tool.

For info, this is the help text from mate (mate --help):

mate 2.13.1 (Aug 26 2019)
Usage: mate [-wl<selection>t<filetype>m<name>rehv] [-u<identifier> | file ...]
       mate [-c<mark>] -s<mark>:<value> -l<line> [-u<identifier> | file ...]
       mate -c<mark> [-l<line>] [-u<identifier> | file ...]

Options:
 -w, --[no-]wait                 Wait for file to be closed by TextMate.
 -l, --line <selection>          Setup <selection> after loading file.
 -t, --type <filetype>           Treat file as having <filetype>.
 -m, --name <name>               The display name shown in TextMate.
 -r, --[no-]recent               Add file to Open Recent menu.
 -u, --uuid <identifier>         Reference already open document with
                                 <identifier>.
 -e, --[no-]escapes              Set this to preserve ANSI escapes from stdin.
 -s, --set-mark <mark>[:<value>] Set a mark with optional <value> (requires --line).
 -c, --clear-mark <mark>         Clear a mark (clears all marks without --line).
 -h, --help                      Show this information.
 -v, --version                   Print version information.

Files opened via mate are added to the recent menu unless
the file starts with a period, --wait or --no-recent is
specified, or the file is in the system’s temporary directory.

By default mate will wait for files to be closed if the command name
has a "_wait" suffix (e.g. via a symbolic link) or when used as a
filter like in this examples:

    ls *.tex|mate|sh    -w implied
    mate -|cat -n       -w implied (read from stdin)

The -l/--line option requires a selection in the following format:

    selection    = <range> ('&' <range>)*
    range        = <pos> | <normal_range> | <column_range>
    pos          = <line> (':' <column>)? ('+' <offset>)?
    normal_range = <pos> '-' <pos>
    column_range = <pos> 'x' <pos>
    line         = [1-9][0-9]*
    column       = [1-9][0-9]*
    offset       = [1-9][0-9]*

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

3 participants