Trying to use awk to split each line. If there is more the one p or q the second split on the ( does not work correctly (line 2 is an example. I am not able to ignore the second if there is more then one occurrence. I tried ^pq but that did not produce the desired. Thank you :).
file
1p11.2(120785011_120793480)x3
1q12q21.1(143192432_143450240)x1~2
awk
awk '{split($0,a,"[pq(_]"); print "id"a[1],a[3]}' file
current
id1 120785011
id1 21.1
desired
id1 120785011
id1 143192432