Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Can NoteTab handle input\output for GAWK in only one way?

Expand Messages
  • Robert Bull
    On Monday, May 7, 2012, 3:28:55 AM, joy8388608 wrote: j Thanks for pointing out the samples in samples.clb. I already j bought sed & awk by Dale Dougherty
    Message 1 of 6 , May 7, 2012
    • 0 Attachment
      On Monday, May 7, 2012, 3:28:55 AM, joy8388608 wrote:

      j> Thanks for pointing out the samples in samples.clb. I already
      j> bought sed & awk by Dale Dougherty (O'Reilly) so will start from

      I hope you bought the second edition, or later. The first edition
      apparently had typos. I prefer The AWK Programming Language for AWK
      itself, but Dougherty's book is still the only one I've seen that
      gives a reasonably comprehensible description of SED.

      j> changed lines so I thought that the way it works is to process all
      j> the lines in a doc (or, I suppose) just the selected lines (what
      j> about partially selected lines???) and replace everything (or just
      j> the selected lines?) in that doc with the output which is the
      j> changed lines matching the selection criteria.

      I think AWK looks at all lines of text given to it, but what if
      anything you get out depends on the script. The traditional way to run
      AWK is from a command line in a console (DOS box). Things are slightly
      different if you run it from inside NT because you can include native
      NT commands in the calling clip, and because you can mark only a
      section of a file in NT and thereby hand that part, only, to AWK.

      I've just done a quick check. If you put an AWK script into a Notetab
      clipbook, select some lines in a file, and tell NT to run the AWK
      script, AWK only processes the *marked* lines. The output from the
      script will replace the original selection only, leaving the rest of
      the (originally unmarked) file as it was. If the marking included only
      part of a line, the excluded part will *not* be processed by AWK.

      j> Wish it was explained a little better somewhere in the NT
      j> documentation.

      So do I :) NT's Help file is good, yet it's often hard to find what
      you want.

      Hope that helps,

      --
      Regards,

      Robert Bull
      mailto:barlennan@...
    Your message has been successfully submitted and would be delivered to recipients shortly.