07-21-2008
how to display 2nd coloumn from a file ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have many text file reports generated by a Information Assurance tool that I need to get into a .CSV format or Excel tab delimited format. I want to use sed or awk to grab all the information in the sample text file below and create column headings:Risk ID, Risk Level, Category, Description, How... (5 Replies)
Discussion started by: Bjoeboo
5 Replies
2. AIX
I need help to split a filename 'a0crk_user:A0-B0123$#%test' into a0crk_user and A0-B0123 and print the output under 2 different columns namely
User and Status.
for eg. the output should like below:
User Status
---- ------
a0crk_user A0-B0123 (3 Replies)
Discussion started by: mbak
3 Replies
3. Shell Programming and Scripting
Hello,
I'm rather new to the world of regular expressions and sed, though am excited by its possibilities. I have a particular task I'd like to achieve, and have googled the topic quite a bit. However, having found some codes that perform a task very similar to what I'd like to do, I can't for... (2 Replies)
Discussion started by: redseventyseven
2 Replies
4. Shell Programming and Scripting
Hi, Iam new to unix. I have one input file .
Input file :
ID1~Name1~Place1
ID2~Name2~Place2
ID3~Name3~Place3
I need output such that only first column should change to fixed width column of 15 characters of length.
Output File:
ID1<<12 spaces>>Name1~Place1
ID2<<12... (5 Replies)
Discussion started by: manneni prakash
5 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I need your help in adding column headings in the below report.
The headings I want are:
Count - Host - Message Type
The command used to create the report is as follows:
for messages in `cat syslog_message_list.txt`
do
grep $messages syslog.`date +%d%m%y`.log | awk '{print $4 " " "... (4 Replies)
Discussion started by: wthomas
4 Replies
6. Shell Programming and Scripting
Match column 3 in file1 to column 1 in file 2 and replace with column 2 from file2
file 1 sample
SNDK 80004C101 AT
XLNX 983919101 BB
NETL 64118B100 BS
AMD 007903107 CC
KLAC 482480100 DC
TER 880770102 KATS
ATHR 04743P108 KATS... (7 Replies)
Discussion started by: rydz00
7 Replies
7. UNIX for Dummies Questions & Answers
Hi all,
I have a file with 3 columns separated by space. Each column has a heading. I want to sort according to the values in the 2nd column (ascending order).
Ex.
Name rank direction
goory 0.05 --+
laby 0.0006 ---
namy 0.31 -+-
....etc.
Output should be
Name rank direction
laby... (3 Replies)
Discussion started by: Unilearn
3 Replies
8. Shell Programming and Scripting
HI I am executing faloowing commands.
mr batch_1 > my_temp.txt ;
mr batch_2 >>my_temp.txt;
mr batch_3 >> my_temp.txt;
mr batch_4 >> my_temp.txt;
and the out put file is as this
cat my_temp.txt
Machine Name Max Load Current Load Factor O/S Status... (3 Replies)
Discussion started by: ptappeta
3 Replies
9. Shell Programming and Scripting
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
Discussion started by: Lakshmikumari
1 Replies
10. Shell Programming and Scripting
Hi all, I have a report that looks like this:
-------------------------------------------------
-- AOC - XXXXXXX --
-------------------------------------------------
Thread Last Sequence Received Last Sequence Applied Difference
----------... (12 Replies)
Discussion started by: cougartrace
12 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)