i have file of 10000 rows, consist some values like below.. i need to fetch the columns only consist of rs, value(0-9), but the problem is rs is not always in first column, column will be differ. so how solve this problem. please help me out
rs1 0.5(0.3-1.5) 0.08
rs2 1.2(1.5-5.0) 0.05
snp1 rs6 12 54 1.8(0.8-8.1) 0.02
ght gt rs7 1.2(1.0-2.8) 0.04
Thank you, Anitha
what have you tried ?
Thank you for your patience.
I tried with this regex format to match column that has value(value), "\d.\d+[([]\d.\d+\–\d.\d+[)]]". From this query its fetching whole rows, but i need a columns that only match with my query.
You should check out grep's options.
-o
is what you need here. Also, please double check your regex.To me it's not clear what you want to obtain, could you (based on your small example) post the desired result?
& (as Pierre asks) it is good practice to show what you tried and the effort you put into it when asking questions on online fora
You say
and number of 'columns' in a row may not be the same. Then it is not a column data. The data format is not optimal. Try to change that if possible.
If the data can only be like that, checkout regular expression and use it.