pawk

Python-based AWK alternative for processing text files line by line

brewmacoslinux
Try with needOr install directly
Source

About

Python line processor (like AWK)

Commands

pawk

Examples

Print specific fields from a space-separated file$ pawk 'print(f[1], f[3])' file.txt
Filter lines matching a pattern and print with line numbers$ pawk 'if "error" in line: print(NR, line)' logfile.log
Sum a column of numbers$ pawk -v total=0 'total += int(f[0])' numbers.txt -v '(print(total))'