Sponsored Content
Top Forums Shell Programming and Scripting Finding line with highest number in a file Post 302343224 by Smiling Dragon on Wednesday 12th of August 2009 03:13:18 AM
Old 08-12-2009
Code:
sort -nk 2 < file1 | tail -1

Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find the highest number in the file

Hi, I have a file a.txt and it has values in it Eg :- I need to read through the file and find the number that is the greatest in them all. Can any one assit me on this. Thanks (30 Replies)
Discussion started by: systemali
30 Replies

2. Shell Programming and Scripting

Finding the line number of matching braces

Hi,I am new to shell scripting and i want to find the line numbers of matching braces. The file contents are as follows File XXX.dat 1 ( CLASS "FRUIT" 2 (TYPE "PERSISTENT") 3 (MESSAGE_TYPE "M") 4 (GET_REQRD "Y") 5 (SET_REQRD "Y") 6 ) 7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies

3. Shell Programming and Scripting

finding the line number from a grep ?

Hi there does anybody know how i can get the line number from an entry or entries in a file ?? for example if i had a file test1 test2 test3 test1 and i needed to get the line numbers for all instances of test1 in that file with the answer being (1,4) Would anybody be able... (7 Replies)
Discussion started by: hcclnoodles
7 Replies

4. Shell Programming and Scripting

Displaying lines of a file which have the highest number?

Hello Wondering if anybody may be able to advise on how I can filter the contents of the following file: <object_name>-<version> <Instance> GM_GUI_code.fmb-4 1 GM_GUI_code.fmb-5 1 GM_GUI_code.fmx-4 ... (7 Replies)
Discussion started by: Glyn_Mo
7 Replies

5. Shell Programming and Scripting

Finding the line with the exact same number

Hello All, What i am doing is , i tail a file from certain chatacter and then cat -n to get the line numbers.I search for a particular string and gets it line number. What i am interested in is the next line immediately after the pattern i search. But grep gives me result for all line... (5 Replies)
Discussion started by: kailash19
5 Replies

6. Shell Programming and Scripting

Bash, finding highest number in another file

i have a problem i am working on and am completely new to bash commands. I writing a script to read another file and output the max and Min number in the script. I must use variables to output the max and min numbers. grades = file with numbers in them. This is what i got so far. Thank You in... (3 Replies)
Discussion started by: ctanner10126
3 Replies

7. Shell Programming and Scripting

finding the line number of a particular line in a file

Hi Frnds, I need to find the line number of a particular line in a file and store that line number to a variable. if a file named myfile contains following look at the sun look at the moon look at the star look at the ocean i need to get the line number of the line 'look at the... (3 Replies)
Discussion started by: mvignesh
3 Replies

8. Programming

Help with find highest and smallest number in a file with c

Input file: #data_1 AGDG #data_2 ADG #data_3 ASDDG DG #data_4 A Desired result: Highest 7 Slowest 1 code that I try but failed to archive my goal :( #include <stdio.h> (2 Replies)
Discussion started by: cpp_beginner
2 Replies

9. Shell Programming and Scripting

Finding the highest value(in negative)

Hi all, I have a simple problem. I have given an example of the problem below. There are 4 space-delimited columns. 2655 96 IA -0.8179 2655 96 IA -0.9144 2655 96 CPU -0.4275 2655 96 RMA -0.3407 2655 96 IA -0.9373 2655 96 ... (2 Replies)
Discussion started by: jaysean
2 Replies

10. Shell Programming and Scripting

help for fast way of finding line number for a regex

Hello, I am trying to find out the line numbers where regex match and put them into a file with below command: awk '/'$pat'/ {print NR}' $fileName >> temp.txt where $pat is the regex but this command is taking a lot of time to execute with bigger files for size more than 5000000... (8 Replies)
Discussion started by: JoeColeEPL9
8 Replies
lpusers(1M)						  System Administration Commands					       lpusers(1M)

NAME
lpusers - set printing queue priorities SYNOPSIS
lpusers -d priority-level lpusers -q priority-level -u login-ID-list lpusers -u login-ID-list lpusers -q priority-level lpusers -l DESCRIPTION
The lpusers command sets limits to the queue priority level that can be assigned to jobs submitted by users of the LP print service. The first form of the command (with -d) sets the system-wide priority default to priority-level, where priority-level is a value of 0 to 39, with 0 being the highest priority. If a user does not specify a priority level with a print request (see lp(1)), the default priority level is used. Initially, the default priority level is 20. The second form of the command (with -q and -u) sets the default highest priority-level (0-39) that the users in login-ID-list can request when submitting a print request. The login-ID-list argument may include any or all of the following constructs: login-ID A user on any system system_name!login-ID A user on the system system_name system_name!all All users on system system_name all!login-ID A user on all systems all All users on all systems Users that have been given a limit cannot submit a print request with a higher priority level than the one assigned, nor can they change a request that has already been submitted to have a higher priority. Any print requests submitted with priority levels higher than allowed will be given the highest priority allowed. The third form of the command (with -u) removes any explicit priority level for the specified users. The fourth form of the command (with -q) sets the default highest priority level for all users not explicitly covered by the use of the second form of this command. The last form of the command (with -l) lists the default priority level and the priority limits assigned to users. OPTIONS
The following options are supported: -d priority-level Set the system-wide priority default to priority-level. -l List the default priority level and the priority limits assigned to users. -q priority-level Set the default highest priority level for all users not explicitly covered. -q priority-level -u login-ID-list Set the default highest priority-level that the users in login-ID-list can request when submitting a print request. -u login-ID-list Remove any explicit priority level for the specified users. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpsu | +-----------------------------+-----------------------------+ SEE ALSO
lp(1), attributes(5) SunOS 5.11 19 Aug 1996 lpusers(1M)
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy