3 ms·
Revised 1.k. w:0:"big10.txt";v:{" ",x}'w;u:{#v[x] _ss " [^ ]"}'!#v;t:{#w[x]}'!#w #w / lines +/u / words +/t / chars Counts for words and chars are cl
by textmode 8y ago
Revised 1.k.
w:0:"big10.txt";v:{" ",x}'w;u:{#v[x] _ss " [^ ]"}'!#v;t:{#w[x]}'!#w
#w / lines
+/u / words
+/t / chars
Counts for words and chars are closer but still short due to inexperience using k.
But it appears the script is now faster than wc.
time -p wc big10.txt
1284570 10956950 64886660 big10.txt
real 2.78
user 2.66
sys 0.12
time -p k 1
1284570
10956830
63602090
real 2.57
user 2.42
sys 0.14