10-20-2011
please restate you requirements, they are unclear.
does your file look like that below, or its is a single continuous stream unbroken by newline as per your example.
if it looks like the below, does your statement
Quote:
I basically need to get the power and the frequency corresponding to the highest number of occurrence number.
which column is power, frequency,occurrence ...
....
0.5000 -142 8
0.5000 -143 19
0.5000 -144 14
0.5000 -145 102
0.5000 -146 122
0.5000 -147 106
0.5452 -96 13
0.5452 -97 14
0.5452 -105 3
0.5452 -110 3
.... ....
16.000 -162 87
16.000 -163 115
16.000 -164 151
16.000 -165 77
.....
---------- Post updated at 11:10 AM ---------- Previous update was at 11:05 AM ----------
hmmm
given your request and the following dataset
Quote:
0.5000 -142 8
0.5000 -143 19
0.5000 -144 14
0.5000 -145 102
0.5000 -146 122
0.5000 -147 106
0.5452 -96 13
0.5452 -97 14
0.5452 -105 3
0.5452 -110 3
.... ....
16.000 -162 87
16.000 -163 115
16.000 -164 151
16.000 -165 77
i would expect
0.5000 -147 122
0.5452 -110 14
16.000 -165 151
not
Quote:
0.5000 -146 122
0.5452 -97 14
....
16.000 -164 151
so, please restate to avoid ambiguity
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have two text file....
One text file contain in this format......
keyvalue.txt \SUM\SUM_cam.c
\SUM\SUM_cam.h
\SUM\SUM_command.c
\SUM\SUM_command.h
\SUM\SUM_dab.c
\SUM\SUM_dmb.c
\SUM\SUM_eventHandler.h
\SUM\SUM_eventHandler_dab.c
\SUM\SUM_eventHandler_dmb.c ... (6 Replies)
Discussion started by: suvenduperl
6 Replies
2. Shell Programming and Scripting
i have two files as
file1:
1
2
3
file2:
a
b
c
and the output should be:
file3:
1~a
2~b
3~c (1 Reply)
Discussion started by: mlpathir
1 Replies
3. Shell Programming and Scripting
What's the best way to format the text file shown below the way in which
COlA ColB ColC ColD
---- ---- ---- ----
70 923 AAA 5864
70 testing AAA 13062
PPPPPP test AAA 142 (0 Replies)
Discussion started by: joe228
0 Replies
4. Shell Programming and Scripting
Dear friends,
I have a file with the text:
href="/archive/ip=x.x.x.x">M</a></td>
I want to extract just the IP number. I tried sed, awk but i didn't succeed.
Any idea?
Thank you
Please view this code tag video for how to use code tags when posting code and data. (3 Replies)
Discussion started by: tts0
3 Replies
5. UNIX for Dummies Questions & Answers
Hello Unix.com
How can I sort from a large email list only the emails that finish with .ca domain?
cat <list> | grep "\.ca\b" >> <new list> isnt working perfectly.
Any tips?
Best regards, Galford D. Weller (2 Replies)
Discussion started by: galford
2 Replies
6. Shell Programming and Scripting
Hi All,
I ahve requirement where I want to put the text file in into proper format. I am wondering how can i achieve that:-
Host/Alias Name IP Address Resolved
sinuiy01.infra.go2uti.com 10.240.8.158 N
sinuid20.devtst.go2uti.com 10.240.8.230 N
sinuid21.devtst.go2uti.com... (6 Replies)
Discussion started by: sharsour
6 Replies
7. Shell Programming and Scripting
Hi All,
I have the below text file from which I have to cut particular section starting from PTR_Security_Rpeorting.cpf to PTR_Security_Reporting_Env93_export.
Report Model............: "D:\Cognos_Publishing\tmp.a2R94KLQec"\PTR_Security_Reporting.cpf
Report Output Script....:... (4 Replies)
Discussion started by: Vikram_Tanwar12
4 Replies
8. Shell Programming and Scripting
Is it possible to replace a line of text within a file while it's closed with a single command or a script? Please show me an example or point me to a webpage that shows an example. The file has this line of text:
LoginGraceTime 100
I want to replace it with the following:
... (2 Replies)
Discussion started by: wdg74
2 Replies
9. Shell Programming and Scripting
Hello again,
I have put together a shell script using sed and some shell commands, and it runs pretty well when I am in terminal, but when I save it as a text file and invoke it through the terminal by typing its path, all I get are errors.
Can some one give me some hints as to what I am doing... (13 Replies)
Discussion started by: Paul Walker
13 Replies
10. Shell Programming and Scripting
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT FREEBSD
isalpha
ISALPHA(3) BSD Library Functions Manual ISALPHA(3)
NAME
isalpha -- alphabetic character test
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <ctype.h>
int
isalpha(int c);
int
isalpha_l(int c, locale_t loc);
DESCRIPTION
The isalpha() function tests for any character for which isupper(3) or islower(3) is true. The value of the argument must be representable
as an unsigned char or the value of EOF.
In the ASCII character set, this includes the following characters (with their numeric values shown in octal):
101 ``A'' 102 ``B'' 103 ``C'' 104 ``D'' 105 ``E''
106 ``F'' 107 ``G'' 110 ``H'' 111 ``I'' 112 ``J''
113 ``K'' 114 ``L'' 115 ``M'' 116 ``N'' 117 ``O''
120 ``P'' 121 ``Q'' 122 ``R'' 123 ``S'' 124 ``T''
125 ``U'' 126 ``V'' 127 ``W'' 130 ``X'' 131 ``Y''
132 ``Z'' 141 ``a'' 142 ``b'' 143 ``c'' 144 ``d''
145 ``e'' 146 ``f'' 147 ``g'' 150 ``h'' 151 ``i''
152 ``j'' 153 ``k'' 154 ``l'' 155 ``m'' 156 ``n''
157 ``o'' 160 ``p'' 161 ``q'' 162 ``r'' 163 ``s''
164 ``t'' 165 ``u'' 166 ``v'' 167 ``w'' 170 ``x''
171 ``y'' 172 ``z''
The isalpha_l() function takes an explicit locale argument, whereas the isalpha() function uses the current global or per-thread locale.
RETURN VALUES
The isalpha() function returns zero if the character tests false and returns non-zero if the character tests true.
COMPATIBILITY
The 4.4BSD extension of accepting arguments outside of the range of the unsigned char type in locales with large character sets is considered
obsolete and may not be supported in future releases. The iswalpha() function should be used instead.
SEE ALSO
ctype(3), islower(3), isupper(3), iswalpha(3), xlocale(3), ascii(7)
STANDARDS
The isalpha() function conforms to ISO/IEC 9899:1990 (``ISO C90''). The isalpha_l() function conforms to IEEE Std 1003.1-2008 (``POSIX.1'').
BSD
July 17, 2005 BSD