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

AWK coding help

AWK coding help

(OP)
1 am newbie in awk.

i have a tab deliminated text file. the format is as follows. 3 records, 4 fields separated by tabs
SNP 100 101 102 103
M1 a:5 b:4 a:26 b:3
M2 a:4 b:45 a:6 b:18
M3 a:50 b:40 a:26 b:30

please help me in filtering the file based on number behind the colon [:] using awk.

1) let's say, if the number after the colon [:] equal or more than 5, then just print "a" or "b"
2)if the number after the colon [:] is less than 5 then print "X".


Thanks in advance

RE: AWK coding help

(OP)
Thanks PHV.

my knowledge about awk is too basic. i copuldn't make a code to process my file. i was teaching hard to myself to learn awk (for example i know split function) though unfortunately i havent reached to the level where i can code myself.

i ll highly appreciate if you acn help me out.

Thanks

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