我有许多包含需要重新格式化的文本的 .txt 文件。具体来说,我有 Speaker A 和 Speaker B,文本在下一行。
A:
I can not believe the weather today .
B:
It is beautiful outside .
A:
Really nice .
B:
Okay , how are you doing ?
A:
I am good .
B:
Good to hear .
A:
Thank you .
可以有更多的发言者,但所有人都会在他们的标签前加上 : 。
我希望文件输出为:
A: I can not believe the weather today .
B: It is beautiful outside .
A: Really nice .
B: Okay , how are you doing ?
A: I am good .
B: Good to hear .
A: Thank you .
谢谢。
编辑:
另外,如果说话者标签之间有多行文本,是否有解决方案?例如:
A:
Well hello .
Long time no see .
How are you doing ?
B:
Good .
How are you ?
A:
Really great .
B:
Good .
有了预期的结果...
A: Well hello . Long time no see . How are you doing ?
B: Good . How are you ?
A: Really great .
B: Good .
GCT1015
繁花不似锦
相关分类