The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-04-2007
user_prady user_prady is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 163
cannot get logic for concatenation awk

Hello friends,

I have a problem in printing an array..

Example if my array line contains 4 elements like following
line[1]=0002 , line[2]=202200, line[3]=200002, line[4]= 300313

Now one = sprintf line[1] line[2] line[3] line[4]
-->
Code:
 one = sprintf line[1] line[2] line[3] line[4]
        
will concatenate my whole array to one.

But I am not sure about the array index how long will it will be ..If more big array came I need to write it again like

one = sprintf line[1] line[2] line[3] line[4] line[5] ..... -->
Code:
 one = sprintf line[1] line[2] line[3] line[4]  line[5] .....
        
Please help me with a logic or code .. how to loop here instead of using index explicitly..

Thanks in advance..