11-08-2012
Thank you but this is giving out the headings for second file only. i want those for first file also. First file contains headings in two rows. Also this script is printing out common column twice.. it need to be printed only once.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
All,
$ cat x.txt
z 11 az
x 12 ax
y 13 ay
$ cat y.txt
ay TT
ax NN
Output required:
y 13 ay TT
x 12 ax NN (3 Replies)
Discussion started by: jkl_jkl
3 Replies
2. Shell Programming and Scripting
Hi guys,
Please guide me if you have a solution to this problem. I have tried paste -s but it's not giving the desired output.
I have a file with the following content-
A123 box1
B345 bat2
C431 my_id
A123 service
C431 box1
A123 my_id
I need two different outputs-
OUTPUT1
A123... (6 Replies)
Discussion started by: smriti_shridhar
6 Replies
3. Shell Programming and Scripting
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies
4. UNIX for Dummies Questions & Answers
I have 100 data files labelled 250.1.txt through 250.100.txt. The second column of the data files partially match (there is about %90 overlap). Each data file has 4 columns.
I want the merge all these text files by the matching values in the second column. In the output, the first column should... (1 Reply)
Discussion started by: evelibertine
1 Replies
5. UNIX for Dummies Questions & Answers
Dear all
I have big file with two columns
A_AA960715 GO:0006952
A_AA960715 GO:0008152
A_AA960715 GO:0016491
A_AA960715 GO:0007165
A_AA960715 GO:0005618
A_AA960716 GO:0006952
A_AA960716 GO:0005618
A_AA960716... (15 Replies)
Discussion started by: AAWT
15 Replies
6. Shell Programming and Scripting
I have two files
1.txt
34, ABC, 7, 8, 0.9
35, CDE, 6.5, -2, 0.01
2.txt
34, ABC, 9, 6, -1.9
35, CDE, 8.5, -2.3, 5.01
So in both files common columns are 1 and 2
so final o/p should look like
34, ABC, 7, 8, 0.9, 9, 6, -1.9
35, CDE, 6.5, -2, 0.01, 8.5, -2.3, 5.01
I tried using... (3 Replies)
Discussion started by: manas_ranjan
3 Replies
7. Shell Programming and Scripting
I have the following records from multiple files.
415 A G
415 A G
415 A T
415 A .
415 A .
421 G A
421 G A,C
421 G A
421 G A
421 G A,C
421 G .
427 A C
427 A ... (3 Replies)
Discussion started by: empyrean
3 Replies
8. Shell Programming and Scripting
Hi,
I have two files A (2190 rows) and file B (1100 rows). I want to merge the contents of two files based on common field, also I need the unmatched rows from file A
file A:
ABC
XYZ
PQR
file B:
>LMN|chr1:11000-12456:
>ABC|chr15:176578-187678:
>PQR|chr3:14567-15866:
output... (3 Replies)
Discussion started by: Diya123
3 Replies
9. Shell Programming and Scripting
Hi All,
I have 4 files in below format. I took them as an example.
File 1: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file. Inserting character H to the initial of all line like HCTOT.
CTOT 456787897 Low fever
CTOR 556712345 High fever... (2 Replies)
Discussion started by: Mannu2525
2 Replies
10. Shell Programming and Scripting
Hi all,
Say i have multiple files x1 x2 x3 x4, all with common header (date, time, year, age),,
How can I merge them to one singe file "X" in shell scripting
Thanks for your suggestions. (2 Replies)
Discussion started by: msarguru
2 Replies
LEARN ABOUT SUNOS
snmptable
snmptable(1m) System Administration Commands snmptable(1m)
NAME
snmptable - obtain and display an SNMP table
SYNOPSIS
/usr/sfw/bin/snmptable [common options] [-Cb] [-CB] [-Cb] [-Ch] [-CH] [-Ci] [-Cf string] [-Cw width] [agent] [table-oid]
DESCRIPTION
The snmptable command is an SNMP application that repeatedly uses the SNMP GETNEXT or GETBULK requests to query for information on a net-
work entity. The operand table-oid must specify an SNMP table. Both numeric and symbolic (string) OIDs are supported.
The operand agent identifies a target SNMP agent that is instrumented to monitor manageable objects. At its simplest, the agent specifica-
tion consists of a hostname or an IPv4 address. With such an address, the command attempts communication with the agent, using UDP/IPv4 to
port 161 of the given target host. See snmpcmd(1M) for a full list of the possible formats for agent.
OPTIONS
See snmpcmd(1M) for a list of common options. In addition to the common options, snmptable supports the options described below.
-Cb
Display only a brief heading. Any common prefix of the table field names is not displayed.
-CB
Use only GETNEXT, not GETBULK, requests to retrieve data.
-Cf string
The string string is used to separate table columns. With this option, each table entry is printed in compact form, using only the
specified string to separate the columns. This option can be useful if you intend to import the table into a database. Without this
option, the table is displayed in vertically aligned columns.
-Ch
Display only the column headings.
-CH
Do not display the column headings or the table name. Only raw data is displayed.
-Ci
Prepends the index of the entry to all printed lines.
-Cw width
Specifies the width of the lines when the table is printed. If a line is longer than width, lines are truncated to fit within width.
EXAMPLES
Example 1: Retrieving an SNMP Table
The following commands retrieve two-column SNMP tables.
% snmptable -v 2c -c public localhost at.atTable
SNMP table: at.atTable RFC1213-MIB::atTable
atIfIndex atPhysAddress atNetAddress
1 8:0:20:20:0:ab 130.225.243.33
% snmptable -v 2c -c public -Cf + localhost at.atTable
SNMP table: at.atTable
atIfIndex+atPhysAddress+atNetAddress
1+8:0:20:20:0:ab+130.225.243.33
EXIT STATUS
0 Successful completion.
1 A usage syntax error. A usage message is displayed. Also used for timeout errors.
2 An error occurred while executing the command. An error message is displayed.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWsmcmd |
+-----------------------------+-----------------------------+
|Interface Stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
snmpcmd(1M), snmp_variables(4), attributes(5)
BUGS
The test for table-oid actually specifying a table is not perfect. Note also that the test requires the defining MIB file to be loaded.
SunOS 5.10 15 Jan 2004 snmptable(1m)