GithubHelp home page GithubHelp logo

columnize's Introduction

Columnize

List things in columns

columnize is a small python module and command to format a list of words in columns.

Install

The project is using setuptools. To install it, run python3 setup.py install.

Usage

In its simplest form, pipe the output of a command to columnize. For instance:

» echo $PATH | sed 's/:/ /g' | columnize

You can also columnize the content of files:

» columnize test/countries.txt LICENSE README.md

And control the output:

» columnize -w 40 test/countries.txt
Afghanistan  Greenland      Nepal
Akrotiri     Grenada        Netherlands
Albania      Guadeloupe     Nicaragua
Algeria      Guam           Niger
Andorra      Guatemala      Nigeria
Angola       Guernsey       Niue
Anguilla     Guinea         Norway
Antarctica   Guinea-Bissau  Oman
Argentina    Guyana         Pakistan
Armenia      Haiti          Palau
[...]

» columnize -w 80 -s 10 test/countries.txt
Afghanistan          Dominica               Laos                   Poland
Akrotiri             Ecuador                Latvia                 Portugal
Albania              Egypt                  Lebanon                Qatar
Algeria              Eritrea                Lesotho                Reunion
Andorra              Estonia                Liberia                Romania
Angola               Ethiopia               Libya                  Russia
Anguilla             Fiji                   Liechtenstein          Rwanda
Antarctica           Finland                Lithuania              Samoa
Argentina            France                 Luxembourg             Senegal
Armenia              Gabon                  Macau                  Seychelles
[...]

columnize's People

Contributors

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