Giter Club home page Giter Club logo

char-histo's Introduction

char-histo.pl

Overview:

char-histo.pl is a script written in perl6 (raku).

It prints an overview of all used characters in a text file.

The output has the form of a sorted histogramm where the most used character is at the top and the least used character at the bottom.

Usage:

./char-histo.pl <file>

or

perl6 char-histo.pl <file>

Example:

./char-histo.pl char-histo.pl 

count        character                  first(l,c)        last(l,c)
--------     -----------------          ----------        ---------
     679               32 0x20          1,15              112,16
     133     i        105 0x69          1,9               112,19
     130     s        115 0x73          1,5               112,20
     129     t        116 0x74          4,8               112,21
     114               10 0xa           1,21              114,1
     112     '         39 0x27          6,17              111,55
     101     o        111 0x6f          4,13              112,22
      75     -         45 0x2d          71,10             100,37
      73     {        123 0x7b          4,17              111,48
      73     }        125 0x7d          8,1               113,1
      68     n        110 0x6e          1,10              112,8
      62     %         37 0x25          5,8               112,17
      61     h        104 0x68          5,9               112,18
      60     e        101 0x65          1,12              112,14
      56     r        114 0x72          1,6               112,15
      55     l        108 0x6c          1,19              108,50
      43     $         36 0x24          11,21             108,47
      41     ;         59 0x3b          5,10              112,23
      41     c         99 0x63          6,18              102,21
      40     a         97 0x61          6,33              110,12
      31     =         61 0x3d          6,15              108,15
      28     u        117 0x75          1,4               108,18
      27     f        102 0x66          18,6              108,48
      26     ,         44 0x2c          6,27              111,31
      25     y        121 0x79          5,6               111,39
      23     p        112 0x70          1,16              112,5
      21     _         95 0x5f          15,30             85,80
      20     m        109 0x6d          5,5               108,30
      19     d        100 0x64          11,6              110,13
      15     b         98 0x62          1,8               108,17
      14     (         40 0x28          4,14              108,35
      14     )         41 0x29          4,15              108,52
      11     >         62 0x3e          6,24              85,97
      11     1         49 0x31          6,26              88,44
      10     +         43 0x2b          13,33             40,27
       8     H         72 0x48          4,9               111,10
       8     "         34 0x22          26,14             88,58
       7     0         48 0x30          6,40              88,45
       6     F         70 0x46          45,15             112,10
       6     ^         94 0x5e          62,19             64,49
       5     /         47 0x2f          1,3               80,35
       5     .         46 0x2e          37,16             101,51
       4     :         58 0x3a          47,30             103,21
       4     <         60 0x3c          62,37             80,28
       4     |        124 0x7c          63,8              64,9
       3     v        118 0x76          1,14              52,15
       3     A         65 0x41          35,8              107,6
       3     k        107 0x6b          65,20             77,10
       3     ~        126 0x7e          101,34            103,25
       2     #         35 0x23          1,1               88,37
       2     C         67 0x43          11,8              51,12
       2     K         75 0x4b          60,9              111,37
       2     @         64 0x40          75,24             77,9
       1     !         33 0x21          1,2               
       1     6         54 0x36          1,20              
       1     q        113 0x71          26,12             
       1     \         92 0x5c          26,15             
       1     w        119 0x77          50,5              
       1     g        103 0x67          50,28             
       1     8         56 0x38          88,23             
       1     5         53 0x35          88,27             
       1     3         51 0x33          88,39             
       1     x        120 0x78          88,40             
       1     M         77 0x4d          107,5             
       1     I         73 0x49          107,7             
       1     N         78 0x4e          107,8             
----------------------------
different characters: 66
total characters: 2531
total lines: 115

License

Public domain

char-histo's People

Contributors

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