![]() |
|
|
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 |
| More than transposing! | bulash | UNIX Desktop for Dummies Questions & Answers | 3 | 04-11-2008 06:20 PM |
| Transposing string | unibboy | Shell Programming and Scripting | 3 | 02-13-2008 06:12 PM |
| Major Awk problems (Searching, If statements, transposing etc.) | Blivo | Shell Programming and Scripting | 2 | 09-05-2007 07:41 AM |
| file transposing | mskcc | Shell Programming and Scripting | 24 | 08-04-2005 12:23 PM |
| transposing letters | myscsa2004 | Shell Programming and Scripting | 4 | 05-12-2004 11:11 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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! |
|
||||
|
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 04: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 are you seeing different results? Last edited by vgersh99; 09-15-2006 at 05:37 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|