![]() |
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 |
| du from list with du of list total | Movomito | Shell Programming and Scripting | 3 | 05-04-2008 10:33 PM |
| list of unmatched columns | mohan705 | Shell Programming and Scripting | 3 | 12-12-2007 10:37 AM |
| Row to Columns | vskr72 | UNIX for Dummies Questions & Answers | 4 | 03-21-2007 09:53 AM |
| how to generate a random list from a given list | mskcc | Shell Programming and Scripting | 3 | 05-30-2006 04:30 AM |
| Comparing a distinct value in 1 list with another list | manualvin | Shell Programming and Scripting | 6 | 06-22-2004 07:42 AM |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
||||
|
List to columns and awk help
Hi I'm new to this forum and I'm a beginner when it comes to shell programming and awk programming. But I have the following problem:
I've a list like this: 1 2 3 4 5 6 7 8 Either from a file or output from a command. What I would like to do is to arrange these values into x columns with values in each column like this: 1 2 3 4 5 6 7 8 Where x specifies how many columns I would like. Then I would like to add all the values from column 1 and divide it with the numbers of rows (in this case 2). forgot something: this is for a bourne shell script. Is it possible to have x as a variable input when running the script? Or is it possible to, instead of making columns, to add every x element in the list and then take an average? Last edited by baghera; 08-26-2007 at 02:09 PM.. |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|