Sponsored Content
Full Discussion: Sort in AWK
Top Forums Shell Programming and Scripting Sort in AWK Post 302346889 by vgersh99 on Monday 24th of August 2009 10:30:23 AM
Old 08-24-2009
Quote:
Originally Posted by eknryan
Thanks Vgersh99!

I usually use a command line of
Code:
gawk.exe -f filter.awk vel.txt  > filtered_file.txt

How would I use your suggestion in this way? I have played about with the code but only nonsensical results are output to filtered_file.txt

Thanks again

Ryan
I guess I don't understand why you need to use 'gawk' to do the sorting.
Just use a plain/old 'sort' - no need for gawk/awk.
 

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

awk sort help

1. The problem statement, all variables and given/known data: I dont know what I do wrong, I am trying to create shell programming database: I have this command first: && > $fname ... echo $Name:$Surname:$Agency:$Tel:$Ref: >> $fname then I have echo " Name Surname Agency Tel... (2 Replies)
Discussion started by: jeht
2 Replies

2. Shell Programming and Scripting

Sort and count using AWK

Hi, I've a fixed width file where I need to count the number of patterns from each line between characters 1 to 15 . so can we sort them and get a count for each pattern on the file between 1 to 15 characters. 65795648617522383763831552 410828003265795648 6175223837... (5 Replies)
Discussion started by: rudoraj
5 Replies

3. Shell Programming and Scripting

match and sort using awk

Hello, Is it possible to do match and sort the data from two fields in a file using awk? Like for example: input apple cat in rat out sky cat pen rat ball sky cpu pen linux ball unix cpu paper linux phone unix paper phone (8 Replies)
Discussion started by: avatar_007
8 Replies

4. Shell Programming and Scripting

Awk sort and unique

Input file --------- 12:name1:|host1|host1|host2|host1 13:name2:|host1|host1|host2|host3 14:name3: ...... Required output --------------- 12:name1:host1(2)|host1(1) 13:name2:host1(2)|host2(1)|host3(1) 14:name3: where (x) - Count how many times field appears in last column ... (3 Replies)
Discussion started by: greycells
3 Replies

5. Shell Programming and Scripting

awk array sort

I have a file as below Input File: 5/11/2012, dir1, 134 5/11/2012, dir2, 2341 5/11/2012, dir3, 2134 5/11/2012, dir4, 2334 5/12/2012, dir1, 234 5/12/2012, dir2, 2341 5/12/2012, dir3, 2334 5/13/2012, dir1, 234 5/13/2012, dir2, 2341 5/13/2012, dir3, 2334 5/13/2012, dir4, 21134 Now... (6 Replies)
Discussion started by: chakrapani
6 Replies

6. Shell Programming and Scripting

awk sort

input file abc1 abc23 abc12 abc15 output abc1 abc12 abc15 abc23 (9 Replies)
Discussion started by: yanglei_fage
9 Replies

7. UNIX for Dummies Questions & Answers

Sort and vectors on awk

Well, i have a script and it makes a txt like this : Caps 12 cans 9 cols 10 my print line is something like this for(i in a) print i, a; i have to order the txt from higher to low like: (6 Replies)
Discussion started by: matius_88
6 Replies

8. Shell Programming and Scripting

Need help on horizontal sort with AWK

dear friends.. i have data : 20130603;ABCD;ABCD1;14030;51271;0.000;0.000;21.000 20130603;ABCD;ABCD2;14030;51272;4853.000;53591.000;40539.000 20130603;ABCD;ABCD3;14030;51273;38024.000;385068.000;396424.000 20130603;ABCD;EFGH1;14030;51334;285879.000;563964.000;141780.000... (4 Replies)
Discussion started by: buncit8
4 Replies

9. Shell Programming and Scripting

Sort String using awk

Hi, I need help to sort string using awk. I don't want to use sed or perl as I want to add this functionality in my existing awk script Basically I have a variable in AWK which is string with comma separated value. I want to sort that string before using that variable in further processing for... (10 Replies)
Discussion started by: rocky.community
10 Replies

10. Shell Programming and Scripting

Sort by first row - awk

how can i sort the table based on first row? thanks in advance input name d b c a l l1 l2 l3 l4 l1 1 2 3 4 l2 2 2 2 1 l3 1 1 2 2ouput name a b c d l1 l4 ... (4 Replies)
Discussion started by: quincyjones
4 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy