Juggling Pi as a siteswap.—strach
Re: Pi as a siteswap.
13 Apr 2005 23:15:17 GMT
Kelh...@juggler.net.nospam (Kelhoon)

perl -pe ’s/\s//g’ pi100m.txt > pi100mformat.txt

N.B. \n is part of \s, so \n|\s is overkill

How’s that for a try ? What about this for the whole deal ?

gcc unpack_pi.c && ./a.out 1 100000000 < pi100m.hexbin.000 | perl -pe ’s/\s//g’ > pi100mformat.txt—Kelhoon

As is traditional with these sort of things, I was intentionally leaving space for further minimisation :-)—Little

Ah yes, how silly of me! I thought it might be after I posted, but didn’t feel like checking perlre to see if my hunch was right.—Little

Somewhat disappointingly, tr doesn’t support \s otherwise we could have had

tr -d ’\s’

to give

gcc unpack_pi.c && ./a.out 1 100000000 < pi100m.hexbin.000 | tr -d ’\s’ > pi100mformat.txt

Instead we have to use

tr -d ’[:space:]’

which is only one character less that the original perl

We could restrict ourselves to spaces, tabs and new lines to lose four characters over the perl.

tr -d \n\t’

I blame the silly long file names anyway...—Roger