I love AWK; it (and perl) have saved my bacon many times. If your problem involves processing fields within lines of an I/O stream in a *nix environment, of course you or I should use AWK. Particularly me, since I'd never be given a processing task involving more math than a "gozinta" or takeaway, much less anything involving polynomials, natural logs, verb inverses, factorials, ranks above 3, and a whole bunch of stuff that J would do for me if only I understood what it was.
(I would also pick AWK if I had only 5 minutes to learn a new language.) But had AWK never been invented (shudder), and I needed to write it, would I use J? Well, not me, but I know some folks here that might knock it out using J in an afternoon or two. > On Feb 14, 2014, at 9:51 PM, Lee Fallat <ircsurfe...@gmail.com> wrote: > > Hey there, > > As new user to J (but several years experience with C and Java), I > find it very, very interesting. The power of its one liners and > mathematical heritage really have me hooked. I was wondering though > if it has similar capabilities as awk. What's the equivalent to this > awk script in J?: > > BEGIN { FS=";" } > { print $1+$2 } > > This script sets a FieldSeparator to ;, and then for every "row", add > the first and second column and prints it. I would like to replace awk > with J! > > Thank you, > > Lee > > P.S. Excuse me if I've misidentified J sentences. (Sentences -> statements?) > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm