Linked by pkrumins on Thu 19th Feb 2009 12:17 UTC
Thread beginning with comment 349810
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'
by vivainio on Thu 19th Feb 2009 19:06
in reply to "RE: awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'"
RE[3]: awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'
by RandomGuy on Fri 20th Feb 2009 18:50
in reply to "RE[2]: awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'"





Member since:
2008-10-23
First off, Python is not available anywhere, but awk and sed are (almost). Maybe perl is better than python, but anyway, that is not the point.
awk and sed scripts are not there to be maintained. They are not developer tools. They are administrator tools and they are there to make it easy for you to edit or search files quickly. sed and awk are used for one-shot commands in 95% of the cases. Once you have the result, there is no need to maintain the command at all.
How many lines do you have to write in python, just to open a file and read it? In sed or awk, that's 0. The file is open and parsed. There is no way you can make it faster in python.
Edited 2009-02-19 14:22 UTC