Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Print lines which are greater than Post 302409656 by numele on Thursday 1st of April 2010 09:17:01 PM
Old 04-01-2010
Print lines which are greater than

I have a file which has a list of titles and then 14 lines afterwards. I need to find the 1 through 14 lines which are greater than 15k and print the title and the line which matched.

Sample before:
Code:
ABC.CDE.NORTH.NET
1:18427
2:302
3:15559
4:105
5:5
6:2
7:2
8:2
9:4
10:2
11:17
12:2
13:2749
14:4381
XYZ.STUV.NORTH.NET
1:16966
2:354
3:344
4:28
5:3
6:2
7:2
8:2
9:3
10:2
11:2
12:2
13:2
14:2
ABC.STUV.NORTH.NET
1:934
2:391
3:1
4:1
5:2
6:1
7:1
8:1
9:2
10:1
11:1
12:15547
13:6152
14:17193

Here is what I need it to look like:
Code:
ABC.CDE.NORTH.NET
1:18427
3:15559
 
XYZ.STUV.NORTH.NET
1:16966
 
ABC.STUV.NORTH.NET
12:15547
14:17193

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find lines greater than 80 characters in a file

Hi, Can anyone please give me the grep command to find all the lines in a file that exceed 80 columns Thanks, gubbala (8 Replies)
Discussion started by: mrgubbala
8 Replies

2. Shell Programming and Scripting

find lines have 2nd colum value greater than 40

i have a file a.txt 12345,20 34567,10 23123,50 123456,45 how to find lines which hav 2nd entry greater than 40 o/p 23123,50 123456,45 pls help to get o/p (5 Replies)
Discussion started by: devesh123
5 Replies

3. Shell Programming and Scripting

Check numeric fields greater than zero, and delete lines if appropriate

This be the latest in my problems sorting through router logs... I'm half way there on a problem, but I've hit the limitation of my knowledge Got some router interface log files of type router01:GigabitEthernet9/24 is up, line protocol is up (connected) router01: 0 input errors, 0 CRC, 0... (7 Replies)
Discussion started by: Yorkie99
7 Replies

4. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

5. Homework & Coursework Questions

Problem with awk,not able print the file that is greater than 3000 bytes.

My Script: #!/bin/sh date=`date +%y%m%d -d"1 day ago"` in_dir=/vis/logfiles/to_solmis cp `grep -il ST~856~ $inbound_dir/*$date*` /vis/sumit/in_ASN/ for i in /vis/sumit/in_ASN/* do mkdir -p /vis/sumit/inboundasns.$date cp `echo $i`... (1 Reply)
Discussion started by: shrima.pratima
1 Replies

6. Shell Programming and Scripting

Select lines in which column have value greater than some percent of total file lines

i have a file in following format 1 32 3 4 6 4 4 45 1 45 4 61 54 66 4 5 65 51 56 65 1 12 32 85 now here the total number of lines are 8(they vary each time) Now i want to select only those lines in which the values... (6 Replies)
Discussion started by: vaibhavkorde
6 Replies

7. Shell Programming and Scripting

AWK/SED print if 2nd character in a column is greater than 0

We have an access log where column 8 displays the time in seconds like below: Tj8nQAoNgwsAABov9cIAAAFL - 10.13.131.80 - - (0) - "GET /aaaaa/bbbb/bbbb where column 8 is printed (0). We are trying to find how many entries are there that has column 8 greater than 0. Remember $8 is (0) and not... (5 Replies)
Discussion started by: spacemtn5
5 Replies

8. UNIX for Dummies Questions & Answers

Grep lines with numbers greater than 2 digits at the end of the line

I'm trying to grep lines where the digits at the end of each line are greater than digits. Tried this but it will only allow me to specify 2 digits. Any ideas would greatly be appreciated. grep -i '\<\{3,4,5\}\>' file ---------- Post updated at 05:58 PM ---------- Previous update was at 05:41... (1 Reply)
Discussion started by: jimmyf
1 Replies

9. Shell Programming and Scripting

How to print values that are greater than 0.1 in at least 80% of the samples?

input sample1 sample2 sample3 sample4 sample5 sample6 sample7 sample8 sample9 sample10 v1 0.2 0.1 0.1 0 1 2 3 4 9 10 v2 0 0 0.01 0 0 0 0 0 0 0 v3 0 0 0 0 0 ... (35 Replies)
Discussion started by: quincyjones
35 Replies

10. UNIX for Beginners Questions & Answers

Print number of lines for files in directory, also print number of unique lines

I have a directory of files, I can show the number of lines in each file and order them from lowest to highest with: wc -l *|sort 15263 Image.txt 16401 reference.txt 40459 richtexteditor.txt How can I also print the number of unique lines in each file? 15263 1401 Image.txt 16401... (15 Replies)
Discussion started by: spacegoose
15 Replies
NRPORTS(5)						     Linux Programmer's Manual							NRPORTS(5)

NAME
nrports - NET/ROM port configuration file. DESCRIPTION
Nrports is an ASCII file that contains information about each of the NET/ROM ports that are to be used. When dealing with an NET/ROM util- ity such as call, it takes an optional argument that is the port name. This port name is a reference to the line within nrports, which has the same name. The information on each line contains enough information to bind the command to a particular NET/ROM interface, this binding is done by matching the callsign on the line in nrports with the callsign of the port set by ifconfig. The nrports file may contain comments that begin with a # in the first column, or a port description in the following format, each field being delimited by white space: name callsign alias paclen description The field descriptions are: name this is the unique NET/ROM port identifier. callsign the callsign of the NET/ROM interface to bind to. alias this is the alias of the NET/ROM port. paclen is the default packet size for this interface. description a free format description of this interface, this field extends to the end of the line. It may contain spaces. FILES
/etc/ax25/nrports SEE ALSO
call(1), netrom(4), ifconfig(8), nrparms(8). Linux 2 August 1996 NRPORTS(5)
All times are GMT -4. The time now is 07:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy