Sponsored Content
Top Forums Shell Programming and Scripting How to find the X highest values in a list depending on the values of another list with bash/awk? Post 302878800 by zozoo on Monday 9th of December 2013 04:14:14 AM
Old 12-09-2013
Hi you can use sort command to sort the data depending upon the column u wanted and then u get the top two example i have file new with random data

Code:
/var/backup # cat new1                                                            
1,2,3,4,5,6                                                                     
7,9,10,456,123                                                                  
8,123,678,900,100                                                               
/var/backup # sort -nrk2 -t, new1|head -2                                         
8,123,678,900,100                                                               
7,9,10,456,123                                                                  
/var/backup #

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search list of values

I have a file which contains a list of search values $cat my.txt FTIP002671604 FTIP002702940 FTIP002703183 FTIP002414805 And lots of such search values. I have to search these valus in the current directory. Can we do this one command wihtout writing a script. Regards, Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies

2. Shell Programming and Scripting

grep a list of values

Hi everybody! :) :D :D :) it's great to be here since this is my first post. touch /base/oracle/FRA/XMUT00/RMAN_FLAG touch /base/oracle/FRA/XRLL00/RMAN_FLAG find directory name containing RMAN_FLAG : $ find /base/oracle/FRA -name RMAN_FLAG -print|xargs -n1 dirname |sort -u... (3 Replies)
Discussion started by: jolan_louve
3 Replies

3. Shell Programming and Scripting

how do I list my values one per line instead of across it?

I want to list my vars in a script so they look like while read IN var1 var2 var3 var4 do echo $IN done Then in the same script have them read and processed. the closest I can get is as follows but this is obviously wrong. NOTE I want a list not all the entries on one line, that... (5 Replies)
Discussion started by: pobman
5 Replies

4. UNIX for Dummies Questions & Answers

Specific values from a list, awk

Hello together! I have a list like this 1 3 2 5 3 7 4 2 Now I want to take the average of the second column and multiply it by the difference of the first and last value of the first column. I posted an similar thread, but now I wonder how I can tell awk in an easy way to take specific... (2 Replies)
Discussion started by: bjoern456
2 Replies

5. Shell Programming and Scripting

Find and replace values using a list from a file

Hello Guys. I have a very big file where I need to change some values according a list on other file. The following file is were I have the values to be changed. The field where I need to replace the values is File_Nb : File1.txt Obs_Report_Result : # ===== (5)... (19 Replies)
Discussion started by: jiam912
19 Replies

6. Shell Programming and Scripting

Sort and list values from CSV

I have a CSV with below values name,city,2,country name,city,15,country abc,wq,10,afdfd, qeqe,ewqre,1,wqew I need to sort them in ascending order based on the value of column 3 and then , pick the rows with values less than 10 and be able to display the columns in that row. Can anyone... (11 Replies)
Discussion started by: Nevergivup
11 Replies

7. Shell Programming and Scripting

awk to store in a list the values of certain fileds

Dear Group, I have following input: sa;sb;sc;sd;period;ma;mb;mc;md;me sa1;sb1;sc1;sd1;200001;ma1;mb1;mc1;md1;me1 sa2;sb2;sc2;sd2;200002;ma2;mb2;mc2;md2;me2 sa3;sb3;sc3;sd3;200003;ma3;mb3;mc3;md3;me3 first line contains the headers! I want to create with one pass the following output:... (8 Replies)
Discussion started by: suturjik
8 Replies

8. Shell Programming and Scripting

Find common values in python list in ordered format

Hello All, There are various codes available to find the intersection between two sets in python. But my case is the following: I want to find the continual common pattern in different lists compared to list1. (i have underlined the longest common patterns in set a and set b) a = 2, 3, 5,... (1 Reply)
Discussion started by: Zam_1234
1 Replies
TDBBACKUP(8)                                                System Administration tools                                               TDBBACKUP(8)

NAME
tdbbackup - tool for backing up and for validating the integrity of samba .tdb files SYNOPSIS
tdbbackup [-s suffix] [-v] [-h] DESCRIPTION
This tool is part of the samba(1) suite. tdbbackup is a tool that may be used to backup samba .tdb files. This tool may also be used to verify the integrity of the .tdb files prior to samba startup or during normal operation. If it finds file damage and it finds a prior backup the backup file will be restored. OPTIONS
-h Get help information. -s suffix The -s option allows the adminisistrator to specify a file backup extension. This way it is possible to keep a history of tdb backup files by using a new suffix for each backup. -v The -v will check the database for damages (currupt data) which if detected causes the backup to be restored. COMMANDS
GENERAL INFORMATION The tdbbackup utility can safely be run at any time. It was designed so that it can be used at any time to validate the integrity of tdb files, even during Samba operation. Typical usage for the command will be: tdbbackup [-s suffix] *.tdb Before restarting samba the following command may be run to validate .tdb files: tdbbackup -v [-s suffix] *.tdb Samba .tdb files are stored in various locations, be sure to run backup all .tdb file on the system. Important files includes: o secrets.tdb - usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba. o passdb.tdb - usual location is in the /usr/local/samba/private directory, or on some systems in /etc/samba. o *.tdb located in the /usr/local/samba/var directory or on some systems in the /var/cache or /var/lib/samba directories. VERSION
This man page is correct for version 3 of the Samba suite. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. The tdbbackup man page was written by John H Terpstra. Samba 3.5 06/18/2010 TDBBACKUP(8)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy