![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| loop through the directory for files and sort by date and process the first file | dsdev_123 | AIX | 1 | 01-30-2008 05:31 PM |
| while loop inside while loop | panknil | Shell Programming and Scripting | 0 | 01-07-2008 12:49 PM |
| sort -k | Indalecio | Shell Programming and Scripting | 4 | 03-16-2007 04:00 AM |
| sort | eck331 | UNIX for Dummies Questions & Answers | 2 | 06-04-2006 12:49 AM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 11:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need some sort of loop
Here is my dilemma.
I have a file that looks something like this name: Type1 group: Group1 name: Type1 group: Group2 name: Type1 group: Group3 name: Type2 group: Group3 name: Type2 group: Group2 name: Type2 group: Group4 name: Type3 group: Group5 name: Type3 group: Group2 name: Type3 group: Group1 name: Type3 group: Group4 Now I need a loop to create another file that would look like this data_2_1_1 = new Option("Group1","Group1"); data_2_1_2 = new Option("Group2","Group2"); data_2_1_3 = new Option("Group3","Group3"); data_2_2_1 = new Option("Group3","Group3"); data_2_2_2 = new Option("Group2","Group2"); data_2_2_3 = new Option("Group4","Group4"); data_2_3_1 = new Option("Group5","Group5"); data_2_3_2 = new Option("Group2","Group2"); data_2_3_3 = new Option("Group1","Group1"); data_2_3_4 = new Option("Group4","Group4"); Notice how the second and third digit increments The second will increment when the type changes and the third one will increment with as many GROUPS that the TYPE belongs to. Thanks for all the help! |
|
||||
|
Your good thanks ... ! Exactly what I needed!
Will keep these handy! |
| Sponsored Links | ||
|
|