jftuga / freq Goto Github PK
View Code? Open in Web Editor NEWDisplay the frequency of each line in a file or from STDIN
License: MIT License
Display the frequency of each line in a file or from STDIN
License: MIT License
c:\> dir | freq -ss 2
panic: runtime error: slice bounds out of range
goroutine 1 [running]:
main.ReadInput(0xc00007bf08, 0x0, 0x2, 0x0, 0x16)
/home/jftuga/go/src/github.com/jftuga/freq/freq.go:151 +0x58b
main.main()
/home/jftuga/go/src/github.com/jftuga/freq/freq.go:228 +0x3dc
To create a test file, start with:
find / 2> /dev/null | awk 'BEGIN {RS="/"} { print }' | grep -v ^$ > 1.txt
cat 1.txt 1.txt 1.txt 1.txt 1.txt > 2.txt
cat 2.txt 2.txt 2.txt 2.txt 2.txt > 3.txt
On MacOS 10.14 this leads to file sizes:
-rw-r--r-- 1 jftuga jftuga 2.0M Sep 2 15:11 1.txt
-rw-r--r-- 1 jftuga jftuga 568M Sep 2 15:08 2.txt
-rw-r--r-- 1 jftuga jftuga 2.8G Sep 2 15:08 3.txt
These are decent files to test with as they have redundancy and are fairly large in size.
option to sort ascending
option to output percentage
option to convert to all lowercase
Add a command line option to not display numeric frequencies; only display a sorted, unique list
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.