![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Concatenation | Asteroid | Shell Programming and Scripting | 11 | 04-04-2007 07:15 AM |
| File Concatenation | samit_9999 | UNIX for Dummies Questions & Answers | 3 | 11-21-2006 06:26 AM |
| string concatenation | systemsb | UNIX for Dummies Questions & Answers | 7 | 04-04-2006 01:03 PM |
| Implementing Concatenation(cat) | toughguy2handle | High Level Programming | 2 | 09-22-2005 03:10 AM |
| Concatenation | videsh77 | Shell Programming and Scripting | 2 | 12-14-2004 06:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 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 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.. |
|
||||
|
Quote:
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.. |
|
||||
|
Quote:
Code:
input = ""
for (i=1 ; i < j ; i ++){
input = sprint input "" line[i]
}
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|