Sponsored Content
Top Forums Shell Programming and Scripting [Solved] I need help with a text file. Post 302566314 by munkeHoller on Thursday 20th of October 2011 06:10:12 AM
Old 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

SOLVED: Text file compare using perl

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

[solved] merging two files and writing to another file- solved

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

Solved: Text formatting

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

[SOLVED] Extract IP from text

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

[Solved] Text manipulation help

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

[Solved] Formatting the text file

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

[Solved] How to print specific text from a file?

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

[Solved] Replacing line of text while file is closed

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

[Solved] My script executes poorly as a text file.

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

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

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
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 05:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy