Giter Club home page Giter Club logo

tabular's Introduction

tabular

Reads a simple .CSV file and allows you to do operations on it

image

Running the example

Acquiring the source

git clone https://github.com/thepsauce/tabular.git
cd tabular

Building

./build.sh

Now you have these options

Show usage:

  • ./tabular

Print the whole file column by column:

  • ./tabular example.csv --all --print

Print the "Kiwi" column:

  • ./tabular example.csv --all --set-row Kiwi --print

View the table in a TUI:

  • ./tabular example.csv --all --view

View all columns matching "Product*":

  • ./tabular example.csv --all --set-column "Product*" --view

View the table and make operations, write it to a file after quitting:

  • ./tabular example.csv --all --set-column "Product*" --view --output output.csv

Append a row:

  • ./tabular example.csv --append "i;am;new;here" --all --output append.csv

Tabular uses getopt, the above can be written as:

  • ./tabular example.csv -d"i;am;new;here" -aoappend.csv

Append a column:

  • ./tabular example.csv --append-column Value --all --output append_column.csv

Note: This does not show all options, just the most interesting ones.

The --view option

This option gives you a TUI interface to interact with the table. It is a mode editor, you have three modes: Normal, Insert, Command.

Normal mode

ARROW KEYS hjkl Move the cursor
HOME 0 Move the cursor to the first column
END $ Move the cursor to the last column
g/G Move the cursor to the first/last row
TAB SPACE Move to the next cell
BTAB BACKSPACE Move to the previous cell
d Delete the current row
x Delete the current column
A Append an empty row
u Undo
CTRL+R Redo
> Increase the column width
< Decrease the column width
r Update all column widths
i Go to insert mode
: Go to command mode
Q Quit

Insert mode

LEFT RIGHT Move the cursor in the input field
BACKSPACE Delete previous character
DEL Delete character
CTRL+U Delete line
HOME Go to the beginning of the line
END Go to the end of the line
ENTER Update the cell
ESC Return to normal mode

Command mode

Same as insert mode but pressing enter will run the command, these are all commands:

  • i[nfo], p[rint], w[rite] (output), r[ead] (input)
  • all [A], all-rows [Ar], all-cols [Ac]
  • invert [I], invert-rows [Ir], invert-cols [Ic]
  • none [N], no-rows [Nr], no-cols [Nc]
  • r[ow], c[ol], set-row [sr], set-col [sc]
  • a[ppend], append-col [ac]
  • undo [U], redo [R]
  • q[uit]

They have a one to one correspondence to the program options.

tabular's People

Contributors

thepsauce avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.