Posts Tagged ‘regexps’

More late-night Linux

grep -B 3 average stuart.out | grep -v Turnpoint | sed -e ‘s/cosine/0/g;s/random/1/g;/-/d; s/[[:alpha:][:space:]:]\+/,/g;s/^,8//g; s/,\(([[:digit:]\.]\+)\)//g;s/^,//g’ > clean.csv Yup, I feel that’s quite an impressively long sed argument. It is probably possible to write something more succinct that will have the same effect, but it’d only be even more obfuscated stuart.out is the data collected from [...]