![]() The simplicity of "Python to sort" processing (instead of "Python to awk to sort") prevents the exact kind of questions being asked here. With sort, it rarely helps because sort is not a once-through filter. A quick measurement of awk >file sort file and awk | sort will reveal of concurrency helps. For short sets of data, it has no significant benefit. The pipelining from awk to sort, for large sets of data, may improve elapsed processing time. There's nothing unique about awk's processing that Python doesn't handle. Some of the reasons for suggesting that awk isn't helping.Īwk is adding a step of no significant value. You'd be a lot happier rewriting 'script.awk' into Python, eliminating awk and the pipeline.Įdit. Let it connect two processes with a pipeline. import subprocessĪwk_sort = subprocess.Popen( "awk -f script.awk | sort > outfile.txt",ĭelegate part of the work to the shell. ![]() ![]() You'd be a little happier with the following.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |