The example was awk, not perl. A friend here at the Monestary has since converted the awk to perl for me, but I am getting a syntax message I am stuck on. Something about a right bracket missing, even though all my brackets match/balance. For some reason I could not get 'a2p' to work at all on my machine. The command exists on my machine, but I could not get it to work. Admittedly, I am not sure of the syntax, and I have no explicit documentation on a2p installed either.

Here's why I am trying to convert the awk to perl:

The chunk of code shown is just part of a much, much larger interactive script written in kornshell with some embedded awk. In this (sub)procedure, I had to actually "cut" the input file down to run through the awk code shown in order for it to process it because awk was telling me the record length as too long. Subsequently, I had to run the output of the awk procedure through a 'grep' to put the records selected back together again. The file is about 5000 records, and each record is a little over 7000 bytes long. The grep was taking forever when the range passed to the awk procedure was long.

So, I am trying to convert the awk to perl to overcome the record length problem, and get rid of the 'grep' to speed up the process.

The process writes out selected records from the iput file, based on whether an identifier is within the range passed on the first record as a set of 'parms'.

I am not a perl programmer (yet!) so if you care to help me out, I will be glad to e-mail you the code snippet, since I do ot know how to format code in this site's text boxes.

Thanks again,
Jim

Edit by tye


In reply to Re: Re: Perl embedded in Kornshell by JALandry
in thread Perl embedded in Kornshell by JALandry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.