Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-25 14:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found