× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I was expanding my programming horizons over the
weekend and ran across this article about awk at
http://www.linux.com/articles/114109

"The power of awk comes from how much it does automatically for you when
crunching text files, and from the simple elegance of the language. When you
feed awk a text file, it does the following:

a.. Opens and reads all input files listed on the command line
b.. Handles memory management for all variables
c.. Parses each line and splits it into fields using the field separator
d.. Presents each line of text to your program as variable $0
e.. Presents each field from each line in predefined variables, starting
with $1, $2, ... $N
f.. Maintains many internal variables for your use, such as (but not
limited to):
a.. RS = record separator
b.. FS = field separator
c.. NF = number of fields in the current record
d.. NR = number of records processed so far
g.. Automatically handles conversion between internal data types (string,
floating point, array)
h.. Executes the BEGIN block before processing any records (a good place
to initialize variables)
i.. Executes the END block after processing all records (a good place to
calculate report totals)
j.. Closes all input files listed on the command line"


I really envy those *nix guys. Can you imagine the power
and ease of use that would result from having some sort
of automatic way do all this in RPG?

(For the humor impaired - I know this is exactly what the
cycle does in RPG. I just got a kick out of finding a feature
RPG has had for 44 years described so well.)

Lance



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.