Giter VIP home page Giter VIP logo

grawk's Introduction

grawk

Simple Awk script for generating simple ASCII graphs.

This script needs file (or input data) with following structure:

label caption
height number
width number
offset x number
range x-min y-min x-max y-max
left ticks t-1 t-2 ... t-n
bottom ticks t-1 t-2 ... t-n

x-value-1 y-value-1
x-value-2 y-value-2
...
x-value-n y-value-n

Example

Suppose we want to create a graph from sample.graph file. This file contains:

label Test graph
height 23
width 80
offset x 3
range 0 0 100 100
left ticks 10 20 30 40 50 60 70 80 90
bottom ticks 10 20 30 40 50 60 70 80 90
5 5
10 10
15 15
20 20
25 25
30 30
35 35
40 40
45 45
50 50
55 55
60 60
65 65
70 70
75 75
80 80
85 85
90 90
95 95

Run command:

~/grawk $ awk -f grawk.awk sample.graph
   |---------------------------------------------------------------------------|
   |                                                                       *   |
90 -                                                                   *       |
   |                                                                *          |
80 -                                                            *              |
   |                                                        *                  |
70 -                                                    *                      |
   |                                                *                          |
60 -                                             *                             |
   |                                         *                                 |
50 -                                     *                                     |
   |                                 *                                         |
40 -                             *                                             |
   |                          *                                                |
30 -                      *                                                    |
   |                  *                                                        |
20 -              *                                                            |
   |          *                                                                |
10 -       *                                                                   |
   |   *                                                                       |
   |-------|------|-------|------|-------|-------|------|-------|------|-------|
          10     20      30     40      50      60     70      80     90        
                                    Test graph                                  

grawk's People

Contributors

pouriya avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.