To get all text on a line after a underscore character, split on the first _
character and take the last element of the result:
line.split('_', 1)[-1]
This will also work for lines that do not have an underscore character on the line.
Demo:
>>> 'Grp25_QTY47 5'.split('_', 1)[-1]
'QTY47 5'
>>> 'No underscore'.split('_', 1)[-1]
'No underscore'
Translating this to your code:
import textwrap
ta_to = ta_from.copyta(status=endstatus)
with botslib.opendata(ta_from.filename,'r') as infile:
with botslib.opendata(str(ta_to.idta),'wb') as tofile:
for line in textwrap.wrap(next(infile), 640):
line = line.split('_', 1)[-1]
tofile.write(line + '
')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…