Earlier quoted context omitted.
Perl better? maybe or maybe not. It can be very useful and they are pretty robust. I often found Perl scripts running for years and years without issues at different companies. My main issue with Perl-scripts is that they often are not "readable" by anybody but the original creator. Which of course left the company. (not a fault of Perl itself tough) But your millage may vary and any script can be made (un)readable.
>> My main issue with Perl-scripts is that they often are not "readable" by anybody but the original creator. Anyone writing Perl scripts like this should not be trusted with any programming language. Perl scripts are no less readable than bash scripts or Awk scripts. This is because so much of Perl was written to do the same work as bash, awk, sed, and the other related Unix text processing command line programs, bu…
The Awk Programming Language
111–120 of 159 posts
Re: The Awk Programming Language
#112I was privileged to be one of the technical reviewers for this book. There's a fair bit of the original content (which is still great), but Kernighan's done a great job with some good restructuring and some significant updates, too. The early chapters are very hands-on, with something of a focus on "exploratory data processing", particularly with CSV files. Big data with AWK, you could say. Gawk and awk will soon hav…
Its a crying shame we never settled on a control character separated text format. There's a ascii control characters for record and field (unit) separators. A bit of user space support for that would have been great.
Re: The Awk Programming Language
#113Earlier quoted context omitted.
You are missing out. As a former data engineer/current SRE, I spend my entire day with VSCode/Python/Notebooks/CoPilot banging out python code - but whenever I need to do a complex analysis of a semistructured text file in Awk's claim to fame in my world is that it's cognitive activation energy for anyone who has taken the 3-4 hours to learn the language from start to finish (and that's the awesome thing about the la…
Point taken. I have a Python program that is an elemental version of awk, and I use that for the odd task. I can modify it if needed and I have the entire Python library to help me. Is the text Unicode? HTML? These little details matter. I'm not complaining that someone banged out awk (speaking figuratively) on a Friday afternoon to do something and not have to stay after work. Excellent! My complaint is that the fai…
The first edition manual is probably the greatest example I've ever seen of technical writing as well.
Re: The Awk Programming Language
#114Earlier quoted context omitted.
>> My main issue with Perl-scripts is that they often are not "readable" by anybody but the original creator. Anyone writing Perl scripts like this should not be trusted with any programming language. Perl scripts are no less readable than bash scripts or Awk scripts. This is because so much of Perl was written to do the same work as bash, awk, sed, and the other related Unix text processing command line programs, bu…
Perl can also be hilariously unreadable: https://www.foo.be/docs/tpj/issues/vol4_3/tpj0403-0017.html
Most programming languages can be obfuscated. That does not mean people write code in those programming languages like that:
Javascript: view-source:https://www.google.com/
The truth is that insulting Perl is considered stylish by some, so many people do despite knowing little to nothing about Perl and having never used it.
However, if you want Perl to be hilariously unreadable, why not write it in Latin:
https://metacpan.org/dist/Lingua-Romana-Perligata/view/lib/L...
Or Klingon:
Re: The Awk Programming Language
#115I know lots of people like awk, but I pretend it doesn't exist. Why? Here's my comment on this from 6 years ago[0], >I used awk until I learned Python (long ago). For me, awk was yet another example of the "worse is better" approach to things so common in unix. For example, if you make a syntax error, you might get a message like "glob: exec error," rather than an informative message. "Worse is better" is probably a…
Re: The Awk Programming Language
#116Re: The Awk Programming Language
#117Re: The Awk Programming Language
#118I was privileged to be one of the technical reviewers for this book. There's a fair bit of the original content (which is still great), but Kernighan's done a great job with some good restructuring and some significant updates, too. The early chapters are very hands-on, with something of a focus on "exploratory data processing", particularly with CSV files. Big data with AWK, you could say. Gawk and awk will soon hav…
Would you say the first few chapters are enough to get the 75-80% usefulness for mere mortals like me who will never try to master the full language? Or is the material fairly sprinkled throughout the whole tome?
Re: The Awk Programming Language
#119Earlier quoted context omitted.
Some discussion of that here: https://news.ycombinator.com/item?id=31220841 To be really useful as a format it would just need for text editors to: -display something distinct for the field separator (some editors do this) -treat the record separator character like a carriage return (not aware of any editors that do this)
> To be really useful as a format it would just need for text editors to: -display something distinct for the field separator Which would be trivial too.
Re: The Awk Programming Language
#120I love using Awk, the only thing I miss is that it can't handle complex csv files. Does anyone know how to handle quoted CSV strings like > "foo","bar,baz"