How to extract text from STRING to end of line?

Hi

I have a very large data file with several hundred columns and millions of lines.

The important data is in the last set of columns with variable numbers of tab delimited fields in front of it on each line.

Im currently trying sed to get the data out - I want anything beetween :RES and the end of line in the example two lines below (lines begin with chr):

Currently Im trying variations on

sed -n '/RES/, /$/p' BIGFILE >sedout

which gets me the first set of info before :RES but not after

can anyone help - apologies for the inexperience

chr2 166746903 . CTAA CTAATATAA 999.0 mrd10;tdb0.05;mrd15;mrp0.05;bqb0.05 INDEL;DP=1647;VDB=0.0367;AF1=0.03161;AF2=0.08017,4.387e-06;LRT=4.35e-05;LRT2=0.000173;AC1=14;DP4=1300,129,22,0;MQ=35;FQ=999;PCHI2=0.0107;PC2=0,58;PV4=0.25,7.1e-06,0.43,1.7e-13;EFF=INTRON(MODIFIER||||TTC21B|retained_intron|CODING|ENST00000243344|),INTRON(MODIFIER||||TTC21B|retained_intron|CODING|ENST00000536175|);MPB=U;ABPA=22;ASTHMA=19 GT:PL:DP:SP:GQ:RES 0/0:0,81,255:27:0:93:0 0/0:0,24,153:8:0:36:0 0/0:0,93,238:31:0:99:0 0/1:14,0,135:7:0:4:0 0/0:0,6,64:2:0:18:0 0/0:0,63,245:21:0:75:0 0/0:0,15,140:5:0:27:0 0/0:0,3,35:1:0:15:-1 0/0:0,0,0:0:0:12:0 0/0:0,0,0:0:0:12:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,9,87:3:0:21:0 0/0:0,0,0:0:0:12:0 0/0:0,9,87:3:0:21:0 0/0:0,120,255:40:0:99:0 0/0:0,27,160:9:0:39:0 0/0:0,0,0:0:0:12:0 0/0:0,9,87:3:0:21:0 0/0:0,0,0:0:0:12:0 0/0:0,9,75:3:0:21:0 0/0:0,6,64:2:0:18:0 0/0:0,3,35:1:0:15:-1 0/0:0,87,255:29:0:99:-1 0/0:0,12,106:4:0:24:-1 0/0:0,12,101:4:0:24:0 0/1:14,0,117:7:0:4:0 0/0:0,6,60:2:0:18:0 0/0:0,27,185:9:0:39:0 0/0:0,9,87:3:0:21:0 0/0:0,3,35:1:0:15:-1 0/0:0,81,213:27:0:93:0 0/1:32,3,0:1:0:13:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,0,0:0:0:12:0 0/0:0,24,153:8:0:36:-1 0/0:0,39,228:13:0:51:-1 0/0:0,21,168:7:0:33:0 0/0:0,3,35:1:0:15:-1 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,15,140:5:0:27:0 0/0:0,0,0:0:0:12:-1 0/0:0,6,64:2:0:18:0 0/0:0,15,122:5:0:27:-1 0/0:0,12,106:4:0:24:-1 0/0:0,0,0:0:0:12:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,57,255:19:0:69:0 0/1:35,0,132:10:0:23:0 0/1:14,0,137:7:0:4:0 0/0:0,12,100:4:0:24:0 0/0:0,12,106:4:0:24:0 0/0:0,52,238:29:0:64:-1 0/0:0,72,239:24:0:84:0 0/0:0,60,255:20:0:72:0 0/0:0,21,168:7:0:33:0 0/0:0,55,255:30:0:67:0 0/0:0,42,177:14:0:54:0 0/0:0,39,255:13:0:51:0 0/0:0,3,35:1:0:15:0 0/0:0,181,255:60:0:99:0 0/0:0,18,169:6:0:30:-1 0/0:0,21,145:7:0:33:0 0/0:2,0,212:11:0:10:0 0/0:0,12,94:4:0:24:0 0/0:0,6,70:2:0:18:0 0/0:0,18,156:6:0:30:0 0/0:0,9,98:3:0:21:0 0/1:72,0,23:4:0:41:0 0/1:25,0,29:2:0:13:0 0/1:14,0,137:7:0:4:0 0/0:0,0,0:0:0:12:0 0/0:0,66,255:22:0:78:-1 0/0:0,18,135:6:0:30:0 0/0:0,6,64:2:0:18:0 0/0:0,6,64:2:0:18:0 0/0:0,132,255:44:0:99:0 0/0:8,0,125:8:0:5:-1 0/1:35,0,132:10:0:23:0 0/0:0,15,115:5:0:27:-1 0/0:0,6,70:2:0:18:-1 0/0:0,15,122:5:0:27:0 0/1:41,0,136:8:0:29:-1 0/0:0,6,64:2:0:18:0 0/1:26,0,55:3:0:14:-1 0/0:0,27,185:9:0:39:0 0/0:2,0,139:11:0:10:0 0/0:0,30,165:10:0:42:-1 0/0:0,6,64:2:0:18:0 0/0:0,33,238:11:0:45:0 0/0:0,18,135:6:0:30:0 0/0:0,42,178:14:0:54:0 0/0:0,6,64:2:0:18:0 0/0:0,12,106:4:0:24:0 0/0:0,12,106:4:0:24:0 0/0:0,24,178:8:0:36:0 0/0:0,51,182:17:0:63:0 0/0:0,6,64:2:0:18:0 0/0:0,15,140:5:0:27:-1 0/0:0,24,153:8:0:36:-1 0/0:0,6,64:2:0:18:0 0/0:0,6,64:2:0:18:-1 0/0:0,24,178:8:0:36:0 0/0:0,15,122:5:0:27:-1 0/0:0,6,64:2:0:18:-1 0/0:0,0,0:0:0:12:0 0/0:0,18,154:6:0:30:0 0/0:0,3,35:1:0:15:0 0/0:0,3,35:1:0:15:0 0/0:0,15,122:5:0:27:0 0/0:0,12,106:4:0:24:0 0/0:0,30,165:10:0:42:-1 0/0:0,0,0:0:0:12:-1 0/0:0,6,64:2:0:18:0 0/0:0,0,0:0:0:12:-1 0/0:0,3,33:1:0:15:0 0/0:0,12,105:4:0:24:0 0/0:0,3,35:1:0:15:0 0/0:0,3,35:1:0:15:0 0/0:0,54,245:18:0:66:0 0/0:0,15,122:5:0:27:0 0/0:0,9,87:3:0:21:0 0/0:0,15,122:5:0:27:0 0/0:0,12,106:4:0:24:0 0/0:0,0,0:0:0:12:-1 0/0:0,21,145:7:0:33:-1 0/0:0,9,68:3:0:21:0 0/0:0,15,122:5:0:27:0 0/0:0,9,87:3:0:21:-1 0/0:0,24,151:8:0:36:0 0/0:0,18,148:6:0:30:0 0/0:0,12,106:4:0:24:0 0/0:0,63,184:21:0:75:0 0/0:0,9,87:3:0:21:-1 0/0:0,9,98:3:0:21:0 0/0:0,9,87:3:0:21:0 0/1:14,0,117:7:0:4:0 0/0:0,0,0:0:0:12:0 0/0:0,42,231:14:0:54:0 0/0:0,0,0:0:0:12:0 0/0:0,81,255:27:0:93:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,21,145:7:0:33:0 0/0:0,24,178:8:0:36:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:-1 0/0:0,0,0:0:0:12:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,54,211:18:0:66:0 0/0:0,3,35:1:0:15:0 0/0:0,18,135:6:0:30:0 0/0:0,3,35:1:0:15:0 0/0:0,54,208:18:0:66:0 0/0:0,12,122:4:0:24:0 0/0:0,3,35:1:0:15:0 0/0:0,15,122:5:0:27:0 0/0:0,9,99:3:0:21:0 0/0:0,12,106:4:0:24:0 0/0:0,15,122:5:0:27:0 0/0:0,33,220:11:0:45:0 0/0:0,33,197:11:0:45:-1 0/0:0,18,135:6:0:30:-1 0/0:0,21,145:7:0:33:-1 0/0:0,30,165:10:0:42:0 0/0:0,45,208:15:0:57:0 0/0:0,72,255:24:0:84:-1 0/0:0,15,132:5:0:27:0 0/0:0,21,168:7:0:33:0 0/0:0,21,153:7:0:33:-1 0/0:0,21,168:7:0:33:0 0/0:0,33,169:11:0:45:0 0/0:0,9,87:3:0:21:0 0/0:0,18,135:6:0:30:0 0/0:0,6,64:2:0:18:0 0/0:0,3,35:1:0:15:0 0/0:0,102,214:34:0:99:0 0/0:0,3,35:1:0:15:-1 0/0:0,24,153:8:0:36:0 0/0:0,6,64:2:0:18:0 0/0:0,9,87:3:0:21:0 0/0:0,0,0:0:0:12:-1 0/0:0,6,64:2:0:18:-1 0/0:0,18,135:6:0:30:0 0/0:0,0,0:0:0:12:0 0/0:0,3,35:1:0:15:0 0/0:0,12,122:4:0:24:-1 0/0:0,148,255:49:0:99:0 0/0:0,24,153:8:0:36:0 0/0:0,6,64:2:0:18:-1 0/0:0,3,35:1:0:15:0 0/0:0,15,122:5:0:27:0 0/0:0,9,87:3:0:21:0 0/0:0,3,35:1:0:15:0 0/0:0,3,35:1:0:15:0 0/0:0,18,135:6:0:30:0 0/0:0,18,153:6:0:30:-1 0/0:0,3,35:1:0:15:0 0/0:0,9,99:3:0:21:-1 0/0:0,9,87:3:0:21:0 0/0:0,3,35:1:0:15:-1 0/0:0,24,178:8:0:36:0 0/0:0,12,122:4:0:24:0 0/0:0,18,156:6:0:30:0 0/0:0,6,64:2:0:18:0 0/0:0,24,153:8:0:36:0 0/0:0,39,204:13:0:51:0 0/0:0,9,98:3:0:21:0 0/0:0,9,87:3:0:21:0
chr2 166747345 . TA TAACCAA 999.0 mrd10;sb0.05;tdb0.05;mrd15;mrp0.05 INDEL;DP=2010;VDB=0.0367;AF1=0.04555;AF2=0.1009,7.652e-06;LRT=9.18e-06;LRT2=3.71e-05;AC1=20;DP4=1559,232,39,0;MQ=35;FQ=999;PCHI2=0.00469;PC2=0,71;PV4=0.0069,1,1,4e-23;EFF=INTRON(MODIFIER||||TTC21B|retained_intron|CODING|ENST00000243344|),INTRON(MODIFIER||||TTC21B|retained_intron|CODING|ENST00000536175|),SPLICE_SITE_DONOR(HIGH||||TTC21B|retained_intron|CODING|ENST00000243344|),SPLICE_SITE_DONOR(HIGH||||TTC21B|retained_intron|CODING|ENST00000536175|);MPB=U;ABPA=25;ASTHMA=33 GT:PL:DP:SP:GQ:RES 0/0:0,90,255:30:0:99:0 0/0:0,18,126:6:0:28:0 0/0:0,168,255:66:0:99:0 0/0:0,39,203:13:0:49:0 0/0:0,36,243:12:0:46:0 0/0:0,105,237:35:0:99:0 0/0:0,3,35:1:0:13:-1 0/0:0,9,87:3:0:19:0 0/0:0,3,35:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,3,35:1:0:13:0 0/0:0,3,35:1:0:13:0 0/0:0,3,35:1:0:13:0 0/1:23,0,29:2:0:13:0 0/0:0,3,35:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,6,70:2:0:16:0 0/0:0,78,255:26:0:88:0 0/0:0,69,185:23:0:79:0 0/0:0,3,35:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,3,35:1:0:13:0 0/1:35,3,0:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,0,0:0:0:11:0 0/0:0,60,255:20:0:70:-1 0/0:0,3,35:1:0:13:0 0/1:29,0,18:2:0:19:0 0/1:25,0,29:2:0:15:0 0/0:26,32,85:3:0:16:-1 0/0:0,54,224:18:0:64:0 0/0:0,0,0:0:0:11:0 0/0:0,0,0:0:0:11:0 0/0:0,75,238:25:0:85:0 0/1:35,3,0:1:0:13:0 0/0:0,9,94:3:0:19:-1 0/0:0,0,0:0:0:11:-1 0/0:0,0,0:0:0:11:0 0/0:0,21,167:7:0:31:0 0/0:0,90,213:30:0:99:0 0/1:25,0,58:4:0:15:0 0/0:0,0,0:0:0:11:0 0/0:0,3,35:1:0:13:0 0/0:0,9,87:3:0:19:0 0/0:0,0,0:0:0:11:0 0/0:0,18,169:6:0:28:0 0/0:0,3,35:1:0:13:-1 0/0:0,15,122:5:0:25:0 0/0:0,6,64:2:0:16:-1 0/0:0,0,0:0:0:11:-1 0/0:0,0,0:0:0:11:0 0/0:0,12,106:4:0:22:0 0/0:0,12,119:4:0:22:0 0/0:0,102,255:34:0:99:0 0/0:0,24,151:8:0:34:0 0/0:0,12,106:4:0:22:0 0/0:0,9,98:3:0:19:0 0/0:0,9,98:3:0:19:0 0/0:0,87,255:29:0:97:-1 0/0:0,90,255:30:0:99:0 0/0:0,93,255:31:0:99:-1 0/0:0,22,163:14:0:32:-1 0/0:0,60,255:20:0:70:-1 0/0:0,57,255:19:0:67:-1 0/0:0,42,255:14:0:52:0 0/0:0,15,137:5:0:25:0 0/0:0,175,255:58:0:99:-1 0/0:0,21,166:7:0:31:-1 0/1:29,0,29:2:0:19:-1 0/0:0,48,234:16:0:58:0 0/0:35,35,35:1:0:11:0 0/1:26,0,55:3:0:16:0 0/0:0,12,110:4:0:22:-1 0/1:19,0,87:4:0:9:0 0/0:0,3,35:1:0:13:-1 0/1:16,0,93:5:0:7:0 0/0:0,6,70:2:0:16:-1 0/0:0,0,0:0:0:11:-1 0/0:0,72,185:24:0:82:0 0/0:0,6,70:2:0:16:0 0/0:29,32,61:2:0:13:-1 0/0:0,3,35:1:0:13:-1 0/0:0,202,255:67:0:99:0 0/1:35,0,124:9:0:25:-1 0/1:19,0,76:4:0:9:0 0/0:29,59,243:12:0:40:-1 0/0:0,6,64:2:0:16:-1 0/1:23,0,73:4:0:13:0 0/0:0,12,120:4:0:22:0 0/0:0,6,70:2:0:16:0 0/0:0,12,91:4:0:22:0 0/0:0,39,248:13:0:49:0 0/1:44,0,95:8:0:34:-1 0/0:17,32,134:6:0:25:-1 0/0:0,3,35:1:0:13:0 0/0:0,48,255:16:0:58:0 0/0:0,27,187:9:0:37:0 0/0:0,81,255:27:0:91:0 0/0:0,6,64:2:0:16:0 0/0:0,9,87:3:0:19:-1 0/0:0,9,87:3:0:19:-1 0/0:0,30,208:10:0:40:0 0/0:0,78,255:26:0:88:0 0/0:0,21,145:7:0:31:-1 0/0:0,21,183:7:0:31:0 0/0:0,57,235:19:0:67:0 0/0:0,21,184:7:0:31:0 0/0:0,0,0:0:0:11:0 0/0:0,3,35:1:0:13:-1 0/0:0,3,35:1:0:13:0 0/0:0,18,154:6:0:28:-1 0/0:0,21,141:7:0:31:0 0/0:0,15,140:5:0:25:0 0/0:0,24,180:8:0:34:-1 0/0:0,0,0:0:0:11:0 0/0:0,0,0:0:0:11:0 0/0:0,6,64:2:0:16:0 0/0:0,9,87:3:0:19:-1 0/0:0,9,87:3:0:19:-1 0/0:0,6,70:2:0:16:0 0/0:0,0,0:0:0:11:0 0/0:0,0,0:0:0:11:0 0/0:0,15,117:5:0:25:0 0/0:0,12,122:4:0:22:0 0/0:0,12,106:4:0:22:0 0/0:0,75,255:25:0:85:0 0/0:0,39,175:13:0:49:0 0/0:0,30,162:10:0:40:-1 0/0:0,6,70:2:0:16:0 0/0:0,0,0:0:0:11:-1 0/0:0,0,0:0:0:11:0 0/0:0,18,148:6:0:28:-1 0/0:0,0,0:0:0:11:0 0/0:0,30,191:10:0:40:0 0/0:0,18,144:6:0:28:0 0/0:0,45,255:15:0:55:0 0/0:0,0,0:0:0:11:0 0/0:0,12,106:4:0:22:-1 0/0:0,82,252:35:0:92:-1 0/0:0,6,64:2:0:16:0 0/0:0,0,0:0:0:11:0 0/0:29,32,44:2:0:13:0 0/0:0,9,83:3:0:19:0 0/0:0,6,64:2:0:16:0 0/0:0,39,228:13:0:49:0 0/0:0,12,102:4:0:22:0 0/0:0,48,210:16:0:58:0 0/0:0,0,0:0:0:11:0 0/0:0,0,0:0:0:11:-1 0/0:0,3,35:1:0:13:0 0/0:0,12,128:4:0:22:-1 0/0:0,3,35:1:0:13:0 0/0:0,3,35:1:0:13:0 0/0:0,6,64:2:0:16:-1 0/0:0,9,82:3:0:19:0 0/0:0,6,64:2:0:16:0 0/0:0,0,0:0:0:11:-1 0/0:0,3,35:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,3,35:1:0:13:0 0/0:0,3,35:1:0:13:0 0/0:0,0,0:0:0:11:0 0/0:0,6,64:2:0:16:-1 0/0:0,21,187:7:0:31:0 0/0:0,78,255:26:0:88:0 0/0:0,15,111:5:0:25:0 0/0:0,30,191:10:0:40:0 0/0:0,30,164:10:0:40:0 0/0:0,6,64:2:0:16:-1 0/0:0,6,64:2:0:16:-1 0/0:0,9,84:3:0:19:0 0/0:0,75,255:25:0:85:-1 0/0:0,63,255:21:0:73:0 0/0:0,39,200:13:0:49:-1 0/0:0,24,174:8:0:34:0 0/0:0,75,255:25:0:85:-1 0/0:0,81,213:27:0:91:0 0/0:0,72,244:24:0:82:-1 0/0:0,3,35:1:0:13:-1 0/0:0,6,64:2:0:16:0 0/0:0,18,133:6:0:28:0 0/1:16,0,93:5:0:7:-1 0/0:0,63,213:21:0:73:0 0/0:0,3,35:1:0:13:0 0/0:0,51,255:17:0:61:0 0/0:0,18,135:6:0:28:0 0/0:0,0,0:0:0:11:-1 0/0:0,123,215:41:0:99:-1 0/0:0,39,203:13:0:49:0 0/0:0,6,64:2:0:16:-1 0/0:0,15,137:5:0:25:0 0/0:0,0,0:0:0:11:-1 0/0:35,35,35:1:0:11:-1 0/0:0,0,0:0:0:11:-1 0/0:0,36,173:12:0:46:-1 0/0:0,6,64:2:0:16:0 0/0:26,32,85:3:0:16:0 0/0:0,12,103:4:0:22:0 0/0:0,229,255:76:0:99:0 0/0:0,96,255:32:0:99:-1 0/0:0,24,153:8:0:34:0 0/0:29,32,61:2:0:13:0 0/0:17,32,132:6:0:25:0 0/0:0,18,150:6:0:28:-1 0/0:0,3,35:1:0:13:-1 0/0:0,3,35:1:0:13:-1 0/0:0,13,151:11:0:23:-1 0/0:0,6,70:2:0:16:0 0/0:0,12,122:4:0:22:-1 0/0:0,6,64:2:0:16:0 0/0:26,32,85:3:0:16:0 0/0:23,32,97:4:0:19:-1 0/0:14,32,144:7:0:28:-1 0/0:0,12,106:4:0:22:0 0/0:0,21,144:7:0:31:0 0/0:10,0,135:7:0:3:-1 0/0:0,117,255:39:0:99:0 0/0:0,66,211:22:0:76:0 0/0:0,3,35:1:0:13:0 0/0:0,30,163:10:0:40:0

[LEFT]It would be better to past your input file under code tags

This will extract you the last column on a tab delimited file..

awk -F"\t" '{print $NF}' file 

[/LEFT]

sed "s/.*:RES//" file
1 Like

Something like this

awk -F":RES" '/:RES/ {print ":RES" $2}'

This will print from :RES to end of line for all lines containing :RES

1 Like

many thanks

the sed command worked well

---------- Post updated at 06:07 AM ---------- Previous update was at 06:05 AM ----------

as did the awk - many thanks