![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| More than transposing! | bulash | UNIX Desktop for Dummies Questions & Answers | 3 | 04-11-2008 02:20 PM |
| Transposing string | unibboy | Shell Programming and Scripting | 3 | 02-13-2008 02:12 PM |
| Major Awk problems (Searching, If statements, transposing etc.) | Blivo | Shell Programming and Scripting | 2 | 09-05-2007 03:41 AM |
| file transposing | mskcc | Shell Programming and Scripting | 24 | 08-04-2005 08:23 AM |
| transposing letters | myscsa2004 | Shell Programming and Scripting | 4 | 05-12-2004 07:11 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Another transposing issue
Hello
I need to sort a file with data such as so it breaks on column 1 and all the data in column 2 is sorted into rows with a unique column 1: 1 5 1 6 1 7 2 3 2 4 3 7 3 0 3 9 So it comes out as: 1 5 6 7 2 3 4 3 7 0 9 I've tried many iterations of nawk but can't get it working!!! Thanks in advance! |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
This code will give what the output he has given. if he wants second column to be sorted sort -kn1 -kn2 file | awk ' ...' Last edited by anbu23; 09-15-2006 at 12:08 PM. |
|
||||
|
well..... even assuming fixing the 'sort' options - these syntax is illegal on Sun/Solaris....
Also assuming the OP's sample input file [steve.txt]... Code:
$ sort -n -k 1,1 -k 2,2 steve.txt | nawk -f steve1.awk 2 3 4 3 0 7 9 1 5 6 7 Last edited by vgersh99; 09-15-2006 at 01:37 PM. |
||||
| Google UNIX.COM |