This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Command To Extract Row And Column Wise Data

I have the data in table format..

A 345 456 678 878
B 456 789 543 789
A 567 984 234 567
B 546 576 987 133
C 586 986 643 746
A 354 575 263 564

How can I get rows from above data which have data 'A' in first column..{lease help me...

Thanks

this is not related to bioinformatics, this is just a basic linux operation. You should have a look at 'grep' or ask stackoverflow.com

I don't consider it a given that everyone trying to do bioinformatics would know what grep is. Thus this person could very well be asking a bioinformatics related question. And thus I consider Ashwin's answer informative, and the fact that he included an awk example beneficial for newbies as well as "experts" alike.

1 answer

If you have linux/mac , you can try following :

  1. grep -w ^A FileName > OutputFielName

    OR

  2. awk '{if($1=="A"){print }}' FileName > OutputFileName

Log in to answer this question.