Replaces awk subprocesses with native Python code