Quote:
Originally Posted by gus2000
Code:
awk 'BEGIN{a[1]="abc";a[2]="def";print length(a)}'
2
Once you know the number of elements, you can use a for loop.
|
Thanks for the reply ,, Yes I do know how many elements are in the array,
but my problem is to print it in one variable
suppose if my number of elements in the array is 3 ,then my commnad should look like this
Code:
input = sprint line[1] line[2] line[3]
On the other hand if the number of array element increases suppose to 4 then my command should look like
Code:
input = sprint line[1] line[2] line[3] line[4]
and like wise you can see the sprint line is varying with the index number..
That is my basic need .. pls help..