Link to home
Start Free TrialLog in
Avatar of ThoughtProcess
ThoughtProcessFlag for United States of America

asked on

Should I learn AWK for text manipulation? Or just skip and go straight to Python, Ruby, or Perl?

I've been doing a lot of text manipulation lately, and for most of my day-to-day tasks I've been able to clunk along using grep and sed with the appropriate pipes.  On occasion I'll write a quick one-off C/C++ program if I can't figure out how to parse a file using those tools.

Lately I've had to process some more sophisticated files (such as performing pattern matching across multiple lines), and I'm finally coming to grips with the fact that I need to learn a text manipulation language.  It will be a welcome addition to my mental tool belt.

I know there are a host of contenders out there (Python, Ruby, Perl, and AWK come to mind).  AWK seems nice because it's purpose-built for text manipulation.  At the same time, I understand that Python or Ruby can do text manipulation *and* build sophisticated applications.  And then there's Perl, which seems so massive and powerful that I'm not sure how to weigh it against the other options.

Is there any significant reason to learn AWK *in addition to* or *instead of* one of these other languages, if I just want to do text processing?

Thanks!
Avatar of Harisha M G
Harisha M G
Flag of India image

As you've mentioned, PERL is sufficient.. All others are like subsets of it. And what you can do in awk can be done in perl with almost same or even less code
Avatar of rumi78
rumi78

it's question like
'if I learning bash should I know ls command', the answer is no, you can use double <tab> pressing when you move to other directory.

awk it very simple 'pipe' text processor, it is very useful, but you can use perl to do the same things
perl is very big, powerful script language.

If you only need to count some statistics, max, min, little calculation on coma separated files awk is enough and one line command.
there are a lot of perl libraries to allow you build big applicatoins, awk does not have any, it is only to simple line reading.

awk you will lern in 1h

I love bash.
rgds
rumi
SOLUTION
Avatar of HonorGod
HonorGod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ThoughtProcess

ASKER

Thanks for the info, guys.  I think I'll pick up AWK for my immediate needs, and then focus on a more full-featured, high-level language as time allows.  It sounds like the similarities between AWK and the other languages make the transition easier than I expected.
Thanks for the assist & points.

Good luck & have a great day.