SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare two files with Awk? DrD2009 Bioinformatics 15 02-08-2017 09:00 PM
awk help jaisask Bioinformatics 0 01-17-2015 05:01 PM
awk help SDPA_Pet Bioinformatics 10 03-31-2014 04:44 AM
Awk command rkk Bioinformatics 23 02-28-2013 05:34 AM
Help with awk Vanisha Bioinformatics 9 09-08-2011 08:11 PM

Reply
 
Thread Tools
Old 07-29-2015, 06:46 AM   #1
cmccabe
Senior Member
 
Location: chicago

Join Date: Jul 2012
Posts: 354
Default awk to use value to change font and sort

I can not figure out if the calculated value in $2 is less than or equal to 100 then in that line the font is changed to red, then the entire file is sorted in ascending order by $2 Is this possible?

I think the below will print a new file and maybe that's a start:

Code:
 awk '{if((NR>1)&&($4!=last)){printf("%s\t%f\t%s\n", last,  total/len,pg);total=$7;len=1;}else{total+=$7;len+=1};pg=$5;last=$4;}END{printf("%s\t%f\t%s\n",  last, total/len,pg)}' | awk '{if($2>=1000.00)print;}' epilepsy70_average.txt > sort.txt
cmccabe is offline   Reply With Quote
Reply

Tags
awk

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 01:05 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO