Take a look at this tiny program by Graham Fawcett. This
pyline program is something you can use when piping grep, tail, less, etcetera together. Just some ideas:
cat test.log|pyline "line.upper()" cat test.log|pyline "line.replace('Init', 'raargh')" cat test.log|pyline "words.upper()"|less
I keep forgetting the
sed syntax for changing strings,
pyline lets me use some python knowledge in doing stuff like this.
Found it at the daily python . Warning: you might need to do a dos-to-unix line-ending conversion.
My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.
Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):