Code Monkey home page Code Monkey logo

gorearrange's Introduction

gorearrange

Build Status MIT License

Overview

This is a CLI tool to interactively rearrange a text data on a terminal.

Demo

Ubuntu16.04

Windows10

Description

Since I couldn't find CLI tools for manually rearranging text data, I created this CLI tool. For this, at first, I created a Golang library go-rearrange.

Install

Download an executable file from the release page and put to a directory with path.

or

Use go get.

$ go get -u github.com/tanaikech/gorearrange

This CLI tool uses termbox-go and go-rearrange.

Usage

Basically, you can use gorearrange as follows.

$ cat sample.txt | gorearrange

You can use the standard output > to output the result as a file. If you use the command prompt on windows dos, please use type sample.txt | gorearrange.

or

$ gorearrange -i sample.txt

For example, if you use msys2, you can use winpty gorearrange -i sample.txt. You can use an option -o outputfile to output the result as a file.

Help

$ gorearrange help

Keys for rearranging

Use up, down, page up, page down, home, end, enter, back space, Ctrl + c and escape keys.

Key Effect
Up, Down Moving one line
Page up, Page down Moving several lines
Home, End Moving top and bottom of data
Enter Selecting a value to rearrange
Back space or Space Reset the rearranged data
Ctrl + c or Escape Finishing rearranging

Update History

  • v1.0.0 (October 15, 2017)

    Initial release.

  • v1.0.1 (October 16, 2017)

    • As one of outputs, indexmode (bool) was added. If this is true, the rearranged result is output as the change of index for the source data. For example, if the source data and rearranged data are ["a", "b", "c"] and ["c", "b", "a"], respectively. The output will become [2, 1, 0].
  • v1.0.2 (October 18, 2017)

    • From this version, data included multi-bytes characters can be used. At Linux, it works fine. At Windows DOS, rearranging and selecting data can be done. But the displayed data is shifted. Although this may be a bug of termbox-go, I don't know the reason. I'm sorry. On the other hand, data with only single-byte characters works fine. About MAC, I don't have it. If someone can confirm and tell me it, I'm glad.

  • v1.0.3 (January 3, 2020)

    1. It seems that the specification of github.com/urfave/cli was changed by the update of https://github.com/urfave/cli. By this, when go get -u github.com/tanaikech/gorearrange is run, an error occurred. So this error was removed.

TOP

gorearrange's People

Contributors

tanaikech avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  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.