Awk limitation

Use a2p to convert awk to perl, ...

$[ = 1;                 # set array base to 1

while (<>) {
    chomp;      # strip record separator
    @Fld = split(' ', $_, 9999);
    if ($Fld[$#Fld] eq '2007' && $Fld[1] eq '**') {
        $LINE = $_;
    }
}

printf "%20s\n", $LINE;

Hi Ygor,

Thats real cool !!
Thanks for the tips.

Any other conversion of codes command from csh to perl or others which you know of ?

Hi Ygor,

I have another awk code but this awk code uses the shell variable "$col7" .
I tried to use a2p command but it doesn;t work.

Can you help ?

awk '/'"$col7"'/ {print(NR)}' input

Try...

grep -n "$col7" input

Hi Ygor,

This grep command grep the whole line plus append the line no in front.
Can you modify the code such that it will only capture the line number ?

$ grep -n uuu input
2:** xxx yyy gg 44 tt uuu 2007
$

Why don't you pipe it into cut?

Hi,

But i do not know how to cut out only the number part since the number of digits will vary. Can you give some guidance ?

Hi ,

Can anybody help ?
I just need the line number .

Don't just rely on other people. Read the man page for cut. Then construct a cut command that uses ":" as a delimiter, and prints field 1.