INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

lines "bigger-equal" ^02...

lines "bigger-equal" ^02...

(OP)
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,.)

RE: lines "bigger-equal" ^02...

(OP)
btw. lines beginnings with:

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

are also expected on output.

RE: lines "bigger-equal" ^02...

Hi

Do you need to do other processing too ? If not, just change the FS to dash and test $1 :

CODE --> command-line

awk -F '-' '$1>=2' /path/to/input 

Feherke.
feherke.github.io

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close