11-11-2009
Sorting the data right justified with through awk.
Dear all,
I have a inputfile like some what like this -
1000.98651
1000.96696
999.98904
991.66864
986.51829
986.49467
17.44122
16.74039
16.74021
10.92725
desired output
1000.98651
1000.96696
0999.98904
0991.66864
0986.51829
0986.49467
0017.44122
0016.74039
0016.74021
0010.92725
so that i can sort this in ascending order using sort -n.
thanks in advance.
Last edited by admax; 11-11-2009 at 09:18 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a name field in a file which is right justified (yep - its true). I need to strip the leading spaces from the field and write the name out left justified. Again, I think I need to use a sed or awk command but so far, my results are at best disappointing. Thank you in advance from a UNIX... (2 Replies)
Discussion started by: Marcia P
2 Replies
2. Shell Programming and Scripting
Hi guys, just started using awk here.
I've got a file called a.txt which contains a load of numbers on each line e.g.
35
232
654
1
9
4
I want to learn how to do three things:
1. Find the minimum
2. Find the maximum
3. Find the average
I want to learn how to do this using awk.... (5 Replies)
Discussion started by: i_am_a_robot
5 Replies
3. UNIX for Dummies Questions & Answers
Hello. I have an RS/6000 running AIX 4 and I need to be able to see if there are any users that are logged on more than once from the same terminal so I can kick them off to make room for other terminals. 64 connections is the limit. Currently I am doing this:
who | more
and then manually... (11 Replies)
Discussion started by: raidzero
11 Replies
4. Shell Programming and Scripting
hello everyone. I'm hoping someone can help me out here. I have 2 files. It looks like this:
File 1:
abc1, defg, 50.00, mno,990
abc2, cats, 100.00, pops,991
abc3, dogs, 1.00, treat,992
File 2:
990, airplanes, runway, doctor
991, jets, birds, much
990,... (13 Replies)
Discussion started by: crazyhpux
13 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Let's say I have these 3 columns;
NGC1234 6 9
SL899 4 1
NGC1075 8 3
SL709 5 2
And I want to sort the data according to the first column (from a to z) like having them as:
NGC1075 8 3
NGC1234 6 9
SL709 5 2
SL899 4 1
Can that be done... (2 Replies)
Discussion started by: cosmologist
2 Replies
6. UNIX for Dummies Questions & Answers
Hello guys. I need help figuring this one out. It's probably really easy. Thanks in advance!
I have a file say for example containing this:
Rice Food
Carrots Food
Beans Food
Plates Kitchen
Fork Kitchen
Knives Kitchen
I need:
Food Rice, Carrots, Beans
Kitchen Plates, Fork,... (7 Replies)
Discussion started by: visuelz
7 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I have a long list made of 4 columns containing entries such as the following example:
a b c d
0 0 0 0
1 2 1 2
2 5 3 4
3 8 4 6
4 10 9 8
5 15 8 10So the top row is the header and I need to arrange the data in a way as to... (11 Replies)
Discussion started by: pawannoel
11 Replies
8. Shell Programming and Scripting
My actual data looks like below
i have given only format. i can't give exact data format of my requirement due to some reasons. I this set of data lines about 5000
I need to come up with information in below
exact format of my data set :
Line<space>Number1<space>"somedata":... (1 Reply)
Discussion started by: ckaramsetty
1 Replies
9. Shell Programming and Scripting
I have a file which looks roughly like this:
996 mmmmmmm
996 xxxxxxxxxxxxx
99600 ssssssssss
9964 fffffffffffff
and would like to sort it numerically on the first field. I tried:
sort -nr --key=1 ....
The output I get is:
99600 ssssssssss
9964 ... (3 Replies)
Discussion started by: rovf
3 Replies
10. Shell Programming and Scripting
data:
C812F5C9B 0818053014 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED
C812F5C9B 0818054514 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED
C812F5C9B 0818060014 P S SYSPROC SOFTWARE PROGRAM ABNORMALLY TERMINATED
C812F5C9B 0818061514 P S SYSPROC ... (3 Replies)
Discussion started by: SkySmart
3 Replies
LEARN ABOUT OPENSOLARIS
xvgetportattribute
XvGetPortAttribute(3) libXv Functions XvGetPortAttribute(3)
NAME
XvGetPortAttribute - return current port attribute value
SYNOPSIS
#include <X11/extensions/Xvlib.h>
int XvGetPortAttribute(Display *dpy, XvPortID port,
Atom attribute, int p_value);
ARGUMENTS
dpy Specifies the connection to the X server.
port Specifies the port, associated with the given display, for which the attribute values are to be returned.
attribute An atom that identifies the attribute to be queried by this request. Control atoms are obtained using the XInternAtom request
with a string from the following table.
p_value Pointer to the location where the attribute value is written on return.
DESCRIPTION
XvGetPortAttribute(3) returns the current value of the requested port attribute in the integer pointed to by p_value. The attribute is
identified using an Atom that equates to the attribute name. The XInternAtom request can be used with one of the strings below to return a
matching Atom.
-----------------------------------------------------
Attribute String Type Default
-----------------------------------------------------
"XV_ENCODING" XvEncodingID Server dependent
"XV_HUE" [-1000...1000] 0
"XV_SATURATION" [-1000...1000] 0
"XV_BRIGHTNESS" [-1000...1000] 0
"XV_CONTRAST" [-1000...1000] 0
RETURN VALUES
[Success]
Returned if XvGetPortAttribute(3) completed successfully.
[XvBadExtension]
Returned if the Xv extension is unavailable.
[XvBadAlloc]
Returned if XvGetPortAttribute(3) failed to allocate memory to process the request.
DIAGNOSTICS
[XvBadPort]
Generated if the requested port does not exist.
[BadMatch]
Generated if the requested attribute atom does not specify an attribute supported by the adaptor.
SEE ALSO
XvSetPortAttribute(3), XvPortNotify(3)
X Version 11 libXv 1.0.7 XvGetPortAttribute(3)