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
_______________________________________________
BangPypers mailing list
BangPypers@python.org
https://mail.python.org/mailman/listinfo/bangpypers

Reply via email to