11-17-2009
Grepping A Specific Column
Hello,
I have a log file that outputs the data below. I would like to grep and display the data where column is equal '148.'
I've searched the forum, and couldn't find any answers.
I've tried all the grep switches and I get the same result as the log.
I'm thinking I might have to use an if statement and grep; I'm working on a "one-liner" and it's taking me some time. Please help!
log
XJLGZ|380377|2|148|4|1500000|040|21|5|
LGCZL|380696|2|148|3|1500000|100|23|5|
XJLMW|314873|2|20|2|1500000|040|21|5|
XTQCW|381585|2|148|4|1500000|300|12|5|
Z6B65|741481|2|18|4|81500000|310|2|1|
Desired Output
XJLGZ|380377|2|148|4|1500000|040|21|5|
LGCZL|380696|2|148|3|1500000|100|23|5|
TQCW|381585|2|148|4|1500000|300|12|5|
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to grep for filenames containing a specific value within a particular segment. The lines containing the segment I'm looking through reads like "HL^1^^1^1", "10^9^9^0", and "HL^11^4^8^1". I would like to find the data that contains only the number nine after the third caret where the... (4 Replies)
Discussion started by: HLee1981
4 Replies
2. Shell Programming and Scripting
Hi,
I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it.
Here is how the text file looks:
_______________________________________________________
DEVICE STATUS INFORMATION FOR LOCATION 1:
OPER STATES: Disabled E:Enabled ... (5 Replies)
Discussion started by: Issemael
5 Replies
3. Shell Programming and Scripting
Hi,
I have the following text file:
8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm
11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies
4. Programming
I have 20 files that look pretty much like this:
0.01 1 3822 4.97379915032e-14 4.96982253992e-09 0
0.01 3822 1 4.97379915032e-14 4.96982253992e-09 0
0.01 2 502 0.00993165137406 993.165137406 0
0.01 502 2 0.00993165137406 993.165137406 0
0.01 4 33 0.00189645523539 189.645523539 0
0.01 33 4... (5 Replies)
Discussion started by: kayak
5 Replies
5. Shell Programming and Scripting
Hi
I have output of a command saved in a file..
# cat /file.txt
System: cu=4 ent=0.1 mode=on
cu min u s w i
0 500 0.1 0.3 0.5 0.1
1 200 0.5 0.2 0.3 0.0
By using ksh, what I need to do is, I need to grep the u,s,w and i... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
6. Shell Programming and Scripting
Hi
I have a file like
# vi require.txt
1,BANK,Read blocks that cycle.
yellow
Read blocks.
2,ACCOUNT,Finished
Red
Finished .
3,LOAN, pipe
white
pipe
4,PROFIT,Resolve.
black
Resolve
Am using like
cat require.txt | grep -w ACCOUNTThe output I get is (8 Replies)
Discussion started by: Priya Amaresh
8 Replies
7. Shell Programming and Scripting
I have 3-column tab separated data that looks like the following:
act of+n-a-large+vn-tell-v 0.067427
act_com of+n+n-a-large-manufacturer-n 0.129922
act-act_com-com in+n-j+vn-pass-aux-restate-v 0.364499666667
com nmod+n-j+ns-invader-n 0.527521
act_com-com obj+n-a-j+vd-contribute-v 0.091413... (2 Replies)
Discussion started by: owwow14
2 Replies
8. UNIX for Dummies Questions & Answers
Name Num_free Num_active Pct_act Max_Used Reuse_cnt Instance_Name
--------------------------------- --------------- ----------- ------- ----------- ----------- ------------------------------
additional network memory 0 ... (2 Replies)
Discussion started by: Rajeshneemkar
2 Replies
9. Shell Programming and Scripting
I have data in the following tab-separated format (consists of 200 columns all together, this is just a sampling)
</s> 0.001701 0.002025 0.002264 0.001430 -0.001300
. -0.205240 0.177341 -0.426209 -0.661049 -0.048884 0.027032
the -0.159145 0.084377 0.056968 0.050934 0.160689
of -0.230698... (7 Replies)
Discussion started by: owwow14
7 Replies
10. Shell Programming and Scripting
I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file.
Here is the file.
<!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies
mrinfo(8) System Manager's Manual mrinfo(8)
NAME
mrinfo - Displays configuration information from a multicast router
SYNOPSIS
/usr/sbin/mrinfo [-d debug_level] [-r retry_count] [-t timeout_count] multicast_router
OPTIONS
Sets the debug level. When the debug level is greater than 0 (the default), additional debugging messages are printed. Regardless of the
debug level, if an error condition occurs, mrinfo writes an error message and terminates. Nonzero debug levels have the following effects:
Prints packet warnings to stderr. Prints all level 1 messages and notifications of down networks to stderr. Prints all level 2 messages
and notifications of all packet timeouts to stderr. Specifies the number of times to retry a neighbor query. The default is 3 retries.
Specifies the number of seconds to wait for a neighbor to reply to a query. The default timeout is 4 seconds.
DESCRIPTION
The mrinfo command displays the configuration information from the multicast router multicast_router.
The mrinfo command sends the ASK_NEIGHBORS IGMP message to the specified multicast router. If the multicast router responds, the response
includes the version number and a list of addresses for their neighboring multicast routers. If the responding router has a recent multi-
cast version number, mrinfo requests additional information such as metrics, thresholds, and options from the multicast router. Once the
specified multicast router responds, the configuration is displayed to the standard output.
RESTRICTIONS
You must be superuser in order to run mrinfo.
EXAMPLES
The following example shows the output of the mrinfo command where mbone.phony.dom.net is specified as the multicast router: mrinfo
mbone.phony.dom.net 127.148.176.10 (mbone.phony.dom.net) [version 3.3]:
127.148.176.10 -> 0.0.0.0 (?) [1/1/querier]
127.148.176.10 -> 127.0.8.4 (mbone2.phony.dom.net) [1/45/tunnel]
127.148.176.10 -> 105.1.41.9 (momoney.com) [1/32/tunnel/down]
127.148.176.10 -> 143.192.152.119 (mbone.dipu.edu) [1/32/tunnel]
For each neighbor of the queried multicast router, the IP address of the queried router is displayed, followed by the IP address and name
of the neighbor. In square brackets, the metric (cost of connection) and the threshold (multicast ttl) are displayed. If the queried multi-
cast router has a newer version number, the type (tunnel, srcrt) and status (disabled, down) of the connection are displayed.
SEE ALSO
Commands: map-mbone(8), mrouted(8), mtrace(8)
Networking: mbone.info(7)
mrinfo(8)