Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lines "bigger-equal" ^02... 1

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
a file contains lines beginning with:

Code:
00-00:29
00-22:01
120-32:21
01-01:04
00-00:06
00-22:50
00-00:51
00-00:12
00-22:06
00-00:15
01-01:25
00-01:28
00-04:09
01-02:19
00-01:50
00-04:44
00-03:22
04-23:31
00-01:09
00-22:06
00-01:40
00-00:02
00-22:06
00-00:15
00-22:06
00-22:01
00-00:29
00-22:07
00-00:12
04-23:31
00-03:22
01-01:25
00-00:51
345-33:44

I need to get only those line which begins with >= 2 (the digit before "-")

when I sort it and print all lines after first matched ^02- it doesn't work in case there are no ^02- on the input (but there are bigger then 2 matches - e.g. "03-" etc,.)

 
btw. lines beginnings with:

341-33:44
30-22:33
12-33-43

are also expected on output.
 
Hi

Do you need to do other processing too ? If not, just change the [tt]FS[/tt] to dash and test [tt]$1[/tt] :
Code:
awk -F '-' '$1>=2' /path/to/input

Feherke.
feherke.github.io
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top