I know how to do this in a text editor but it shuts my computer down because I have a large file. I have tab-separated data like this all on a single line:
XP_23947974 XM_23947974 HG12390 product=blahblah NP_23947975 XM_23947975 HG12391 product=blahblah2
And I want to insert a line break at every either XP or NP. So, as it is tab-separated, in the text editor I was just going to do
Find:(\D)P_
Replace:\n\1P_
Giving
XP_23947974 XM_23947974 HG12390 product=blahblah
NP_23947975 XM_23947975 HG12391 product=blahblah2
But I want to use sed (etc) to do that. help appreciated.