Sponsored Content
Full Discussion: Help needed to sort file
Top Forums Shell Programming and Scripting Help needed to sort file Post 302137781 by Perderabo on Thursday 27th of September 2007 02:51:26 AM
Old 09-27-2007
Code:
$ cat data
184 ABCD-954 Errorcodedescription1
35645 DFMS-323 Errorcodedescription2
43534 XCVW-8793 Errorcodedescription3
56743 MWDS-234 Errorcodedescription4
$ sort -t- -k2n data
56743 MWDS-234 Errorcodedescription4
35645 DFMS-323 Errorcodedescription2
184 ABCD-954 Errorcodedescription1
43534 XCVW-8793 Errorcodedescription3
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sort - Help Needed

Hi, I am facing a small problem while I am doing the sort. Problem Definition: I have a file which has the following data. >cat test.dat zxzxc asdasd qwaxcZa qwaxcA When I do a sort on this file. the result set is asdasd qwaxcA (4 Replies)
Discussion started by: Andysundar
4 Replies

2. UNIX for Dummies Questions & Answers

help needed with sort. pipe and popen()

Suppose I want to find the number of uniq lines in a file. I use the following command: sort file1 | uniq -c | wc -l But if for some reason sort fails, the above command returns 0 as the answer. Why would sort fail ? sort makes use of directories /tmp or /var/tmp to store temporary files.... (7 Replies)
Discussion started by: the_learner
7 Replies

3. UNIX for Dummies Questions & Answers

Help needed to sort multiple columns in one file

Hi, I would like to know given that I have 3 columns. Let say I have first 3 columns to do operation and these operation output is printed out each line by line using AWK and associative array.Currently in the output file, I do a sort by -r for the operation output. The problem comes to... (1 Reply)
Discussion started by: ahjiefreak
1 Replies

4. Shell Programming and Scripting

sort command help needed.

Hello, suppose i have a student.dat file whose format is studentno studentname semester marks1 marks2 marks3 total then how can i sort first in semester wise and then total wise? I mean semester wise ranking wise record should be displayed. Semester should be displayed in ascending order... (6 Replies)
Discussion started by: salman4u
6 Replies

5. Shell Programming and Scripting

Help needed with Sort and uniq data

Hi All, After Sorting directories and files i have got following output as below, now i only want the strings common in them, so the actual output should be as below in the bottom. How do i do that? Thanks -adsi File to be modified:- Common Components for ----> AA... (4 Replies)
Discussion started by: asirohi
4 Replies

6. Shell Programming and Scripting

Help needed to sort data

Hello All, Today i have been asking lots of question, hope to become good in scripting soon with all the wonderful advices i get. The question is i want to sort data a get uniq string from it. The code i am using to generate the output is:- check_sun() { for i in $SUN_PLATFORM do $ECHO... (0 Replies)
Discussion started by: asirohi
0 Replies

7. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

8. Shell Programming and Scripting

sort command help needed

I have a file with three fields of data for example say we have 1420 $12.56 45 3456 $15.89 14 2341 $25.87 32 I need to use a command to show who is getting paid the highest amount to standard output. I am not sure if I should use a sort command or a copy and paste... (1 Reply)
Discussion started by: drew211
1 Replies

9. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

10. UNIX for Beginners Questions & Answers

How to align/sort the column pairs of an csv file, based on keyword word specified in another file?

I have a csv file as shown below, xop_thy 80 avr_njk 50 str_nyu 60 avr_irt 70 str_nhj 60 avr_ngt 50 str_tgt 80 xop_nmg 50 xop_nth 40 cyv_gty 40 cop_thl 40 vir_tyk 80 vir_plo 20 vir_thk 40 ijk_yuc 70 cop_thy 70 ijk_yuc 80 irt_hgt 80 I need to align/sort the csv file based... (7 Replies)
Discussion started by: dineshkumarsrk
7 Replies
SNMPDELTA(1)							     Net-SNMP							      SNMPDELTA(1)

NAME
snmpdelta - Monitor delta differences in SNMP Counter values SYNOPSIS
snmpdelta [ common options ] [-Cf] [ -Ct ] [ -Cs ] [ -CS ] [ -Cm ] [ -CF configfile ] [ -Cl ] [ -Cp period ] [ -CP Peaks ] [ -Ck ] [ -CT ] AGENT OID [ OID ... ] DESCRIPTION
snmpdelta will monitor the specified integer valued OIDs, and report changes over time. AGENT identifies a target SNMP agent, which is instrumented to monitor the given objects. At its simplest, the AGENT specification will consist of a hostname or an IPv4 address. In this situation, the command will attempt communication with the agent, using UDP/IPv4 to port 161 of the given target host. See snmpcmd(1) for a full list of the possible formats for AGENT. OID is an object identifier which uniquely identifies the object type within a MIB. Multiple OIDs can be specified on a single snmpdelta command. OPTIONS
COMMON OPTIONS Please see snmpcmd(1) for a list of possible values for COMMON OPTIONS as well as their descriptions. -Cf Don't fix errors and retry the request. Without this option, if multiple oids have been specified for a single request and if the request for one or more of the oids fails, snmpdelta will retry the request so that data for oids apart from the ones that failed will still be returned. Specifying -Cf tells snmpdelta not to retry a request, even if there are multiple oids specified. -Ct Flag will determine time interval from the monitored entity. -Cs Flag will display a timestamp. -CS Generates a "sum count" in addition to the individual instance counts. The "sum count" is the total of all the individual deltas for each time period. -Cm Prints the max value ever attained. -CF configfile Tells snmpdelta to read it's configuration from the specified file. This options allows the input to be set up in advance rather than having to be specified on the command line. -Cl Tells snmpdelta to write it's configuration to files whose names correspond to the MIB instances monitored. For example, snmpdelta -Cl localhost ifInOctets.1 will create a file "localhost-ifInOctets.1". -Cp Specifies the number of seconds between polling periods. Polling constitutes sending a request to the agent. The default polling period is one second. -CP peaks Specifies the reporting period in number of polling periods. If this option is specified, snmpdelta polls the agent peaks number of times before reporting the results. The result reported includes the average value over the reporting period. In addition, the highest polled value within the reporting period is shown. -Ck When the polling period (-Cp) is an increment of 60 seconds and the timestamp is displayed in the output (-Cs), then the default display shows the timestamp in the format hh:mm mm/dd. This option causes the timestamp format to be hh:mm:ss mm/dd. -CT Makes snmpdelta print its output in tabular form. -Cv vars/pkt Specifies the maximum number of oids allowed to be packaged in a single PDU. Multiple PDUs can be created in a single request. The default value of variables per packet is 60. This option is useful if a request response results in an error becaues the packet is too big. EXAMPLES
$ snmpdelta -c public -v 1 -Cs localhost IF-MIB::ifInUcastPkts.3 IF-MIB::ifOutUcastPkts.3 [20:15:43 6/14] ifInUcastPkts.3 /1 sec: 158 [20:15:43 6/14] ifOutUcastPkts.3 /1 sec: 158 [20:15:44 6/14] ifInUcastPkts.3 /1 sec: 184 [20:15:44 6/14] ifOutUcastPkts.3 /1 sec: 184 [20:15:45 6/14] ifInUcastPkts.3 /1 sec: 184 [20:15:45 6/14] ifOutUcastPkts.3 /1 sec: 184 [20:15:46 6/14] ifInUcastPkts.3 /1 sec: 158 [20:15:46 6/14] ifOutUcastPkts.3 /1 sec: 158 [20:15:47 6/14] ifInUcastPkts.3 /1 sec: 184 [20:15:47 6/14] ifOutUcastPkts.3 /1 sec: 184 [20:15:48 6/14] ifInUcastPkts.3 /1 sec: 184 [20:15:48 6/14] ifOutUcastPkts.3 /1 sec: 184 [20:15:49 6/14] ifInUcastPkts.3 /1 sec: 158 [20:15:49 6/14] ifOutUcastPkts.3 /1 sec: 158 ^C $ snmpdelta -c public -v 1 -Cs -CT localhost IF-MIB:ifInUcastPkts.3 IF-MIB:ifOutcastPkts.3 localhost ifInUcastPkts.3 ifOutUcastPkts.3 [20:15:59 6/14] 184.00 184.00 [20:16:00 6/14] 158.00 158.00 [20:16:01 6/14] 184.00 184.00 [20:16:02 6/14] 184.00 184.00 [20:16:03 6/14] 158.00 158.00 [20:16:04 6/14] 184.00 184.00 [20:16:05 6/14] 184.00 184.00 [20:16:06 6/14] 158.00 158.00 ^C The following example uses a number of options. Since the Cl option is specified, the output is sent to a file and not to the screen. $ snmpdelta -c public -v 1 -Ct -Cs -CS -Cm -Cl -Cp 60 -CP 60 interlink.sw.net.cmu.edu .1.3.6.1.2.1.2.2.1.16.3 .1.3.6.1.2.1.2.2.1.16.4 fi SEE ALSO
snmpcmd(1), variables(5). 4th Berkeley Distribution 25 Jul 2003 SNMPDELTA(1)
All times are GMT -4. The time now is 11:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy