Popular recipes by david http://code.activestate.com/recipes/users/4179974/2011-11-25T17:14:57-08:00ActiveState Code Recipesawk-like module (Python)
2011-11-25T17:14:57-08:00davidhttp://code.activestate.com/recipes/users/4179974/http://code.activestate.com/recipes/577962-awk-like-module/
<p style="color: grey">
Python
recipe 577962
by <a href="/recipes/users/4179974/">david</a>
(<a href="/recipes/tags/awk/">awk</a>).
</p>
<p>This python module is similar to awk (pattern scanning and processing language in unix/linux).
It scans the input file for lines, split each line to fields.
*._nr # AWK NR
*._nf # AWK NF
*._0r # AWK $0
*._1 # AWK strip($1)
*._1r # AWK $1 , raw string
*._1i # AWK int($1)
*._1f # AWK float($1)</p>