I have a file;
ADD TABLE "Benefits" AREA "Employee" DESCRIPTION "The benefits table contains employee benefits." DUMP-NAME "benefits" ADD FIELD "EmpNum" OF "Benefits" AS integer FORMAT "zzzzzzzzz9" INITIAL "0" LABEL "Emp No" POSITION 2 MAX-WIDTH 4 VALEXP "CAN-FIND(employee OF benefits)" VALMSG "Employee must exist." HELP "Please enter the Emp Number" ORDER 10 ADD FIELD "HealthCare" OF "Benefits" AS character FORMAT "x(8)" INITIAL "" LABEL "Health Care" POSITION 3 MAX-WIDTH 16 HELP "Please enter the Health Care field."
In my script when i find a field i want to pick up the line below it to grab the format info;
while (<INFILE1>){ # define variables $FULL_LINE = $_; $TABDISPLAY = 0; $FIELDDISPLAY = 0; $DATEFIELD = 0; $SHORTLINE = substr($FULL_LINE,0,length($FULL_LINE)-2); @LINEARRAY[0..9] = split(/"+/, $SHORTLINE); $FIELDLENGTH = ""; $FIELD = ""; $TYPE = ""; # decide if input line is table name or field name if($LINEARRAY[0]=/ADD TABLE/) { $TABLE="$LINEARRAY[1]"; $TABDISPLAY=1; print OUTFILE3 ("table=" . "$TABLE \n"); } elsif ($LINEARRAY[0]=/ADD FIELD/) { $FIELD=$LINEARRAY[1]; $TYPE=$LINEARRAY[4]; $FIELDDISPLAY=1; #need bit in here to pick up next line to set fieldlength belo +w! $FIELDLENGTH=$LINEARRAY[1]; print OUTFILE3 ("field=" . "$FIELD \n"); print OUTFILE3 ("type=" . "$TYPE \n"); print OUTFILE3 ("length=" . "$FIELDLENGTH \n"); }; #snipped the rest
OUTFILE3 currently looks like;
table=Benefits field=EmpNum type= AS integer length=EmpNum field=HealthCare type= AS character length=HealthCare fieldlength=HealthCare srclength=varcharealthCar field=LifeInsurance type= AS integer length=LifeInsurance
Anybody help?? Thanks

In reply to How to skip a line? by Anonymous Monk

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.