[BangPypers] Favorite tips/techniques
Anand Chitipothu
anandology at gmail.com
Wed Sep 11 13:25:41 CEST 2013
Another script I use often is repr.
https://github.com/anandology/hacks/blob/master/repr
It reads each line from stdin and prints it as python repr. Useful to see
hidden/non-alphanumeric characters.
$ echo -e "a\bc"
c
$ echo -e "a\bc" | repr
a\x08c\n
This is similar to od, but od prints fixed number of characters in each
line and sometimes you want to see the lines without breaking.
Couple of hours back, I noticed an issue with a row in a mysql dump, and
here is how I used it to inspect at that row.
$ head -28130 my-table.txt | tail -1 | repr
2006-05-25 00:19:12\t\t1900-01-01 00:00:00\t0000\tMetal1\t
Anand
More information about the BangPypers
mailing list