开启辅助访问 切换到宽版

精易论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

用微信号发送消息登录论坛

新人指南 邀请好友注册 - 我关注人的新帖 教你赚取精币 - 每日签到


求职/招聘- 论坛接单- 开发者大厅

论坛版规 总版规 - 建议/投诉 - 应聘版主 - 精华帖总集 积分说明 - 禁言标准 - 有奖举报

查看: 183|回复: 3
收起左侧

[易语言] 求大神们帮忙修改一段合并文字的源码

[复制链接]
结帖率:83% (10/12)
发表于 2024-3-12 18:34:16 | 显示全部楼层 |阅读模式   山西省长治市
300精币
我有一段文本,格式如下
1
00:00:00,120 --> 00:00:01,650
- In tsfsdg vwer, you're gsdfs tcxv asdfs

2
00:00:01,650 --> 00:00:03,690
fsdf csdf AADAS trgd.

3
00:00:03,690 --> 00:00:06,300
I'll ssdf abcd caba
gvbng uyuyu iasdadqw

4
00:00:06,300 --> 00:00:07,890
basds ortrt tfdfad psfdsrew,

5
00:00:07,890 --> 00:00:10,170
aaa tzcs tsdf csdfwe tsdfs ysdfew
ssdfhyt mqwew puikui

6
00:00:10,170 --> 00:00:12,870
isfs a fsdfwe wsdfwe, tsdfwe csdfwe tsdfwe

7
00:00:12,870 --> 00:00:15,900
tsdfwe csdfwe tsdfew asdfe hsdfs
isdfew asdf tsdfwe psdfwe,

8
00:00:15,900 --> 00:00:18,780
asdf tsdfwe tsdf ssdfe csdfew
tsdfew isdfew psdfew dsdfew

9
00:00:18,780 --> 00:00:20,023
asfew vwerw lwerw twerew,

10
00:00:20,023 --> 00:00:22,980
asdfew wewa tdsfwe wsdfew ysd
ssdfwe ewerwe asfs dwerew

11
00:00:22,980 --> 00:00:25,890
osdfwe ysdfwe psdfew asdfew
oqtrrthf asdf fgere wddvcw.

12
00:00:25,890 --> 00:00:26,723
Ssdfewrwe gxcvw?

13
00:00:26,723 --> 00:00:28,380
Lsadqw gzct stawerewrd wwertg txvsd sdfwe twerwe.

14
00:00:28,380 --> 00:00:30,570
Asdfwe rsdfw, thsdfew fsdfe txew
iswerw cxvew Tysdfwe.

15
00:00:30,570 --> 00:00:32,580
Iwer awewe yosdfsu tqqweos ccvfgt yiuoiu tuikgh

16
00:00:32,580 --> 00:00:36,840
ifhrt trtyr stvbe prerw
vwerewt lewrtwer ywerw scvgre rqweq hvert.

17
00:00:36,840 --> 00:00:38,790
Socfew wewer ycgv txcvew
txcf pxfew youwerwr pvreert

18
00:00:38,790 --> 00:00:42,810
osdfr servrewtdice, simdgwqdsply enewhrtter ygfhourwdsf
tesferewsxt inwrwerto Tvwwrwsf' form,

19
00:00:42,810 --> 00:00:45,390
ansfewrd thiuoity ofhrtt cofhrrts a viretetedeo icvwen secoeretdfnds.


点击“导入文件”,随后再点击“处理文件”, VX截图_20240312183120.png




就可以合并成这样的





1
00:00:00,120 --> 00:00:03,690
- In tsfsdg vwer, you're gsdfs tcxv asdfs fsdf csdf AADAS trgd.

2
00:00:03,690 --> 00:00:25,890
I'll ssdf abcd caba gvbng uyuyu iasdadqw basds ortrt tfdfad psfdsrew, aaa tzcs tsdf csdfwe tsdfs ysdfew ssdfhyt mqwew puikui isfs a fsdfwe wsdfwe, tsdfwe csdfwe tsdfwe tsdfwe csdfwe tsdfew asdfe hsdfs isdfew asdf tsdfwe psdfwe,asdf tsdfwe tsdf ssdfe csdfew tsdfew isdfew psdfew dsdfew asfew vwerw lwerw twerew, asdfew wewa tdsfwe wsdfew ysd ssdfwe ewerwe asfs dwerew osdfwe ysdfwe psdfew asdfew oqtrrthf asdf fgere wddvcw.

3
00:00:25,890 --> 00:00:26,723
Ssdfewrwe gxcvw?

4
00:00:26,723 --> 00:00:28,380
Lsadqw gzct stawerewrd wwertg txvsd sdfwe twerwe.

5
00:00:28,380 --> 00:00:30,570
Asdfwe rsdfw, thsdfew fsdfe txew iswerw cxvew Tysdfwe.

6
00:00:30,570 --> 00:00:36,840
Iwer awewe yosdfsu tqqweos ccvfgt yiuoiu tuikgh ifhrt trtyr stvbe prerw vwerewt lewrtwer ywerw scvgre rqweq hvert.

7
00:00:36,840 --> 00:00:45,390
Socfew wewer ycgv txcvew txcf pxfew youwerwr pvreert osdfr servrewtdice, simdgwqdsply enewhrtter ygfhourwdsf tesferewsxt inwrwerto Tvwwrwsf' form, ansfewrd thiuoity ofhrtt cofhrrts a viretetedeo icvwen secoeretdfnds.



也就是说遇到句号的英文符号时,就让当前文字和上一个大写字母之间的所有字母合并起来,同时也让两个时间轴相结合起来,取上一个时间的首部和当前时间的尾部。


我把界面和源码都写出来了,但不知道源码里面的匹配规则哪里出了问题,还请大神们帮忙修改一下,谢谢。


源码和所需文件都在附件中




新建文件夹 2.zip

771.54 KB, 下载次数: 3


回答提醒:如果本帖被关闭无法回复,您有更好的答案帮助楼主解决,请发表至 源码区 可获得加分喔。
友情提醒:本版被采纳的主题可在 申请荣誉值 页面申请荣誉值,获得 1点 荣誉值,荣誉值可兑换荣誉会员、终身vip用户组。
快捷通道:申请荣誉值无答案申请取消悬赏投诉有答案未采纳为最佳
结帖率:40% (2/5)

签到天数: 9 天

发表于 2024-3-13 11:16:35 | 显示全部楼层   云南省西双版纳傣族自治州
正则处理文本.e (949.66 KB, 下载次数: 3)
回复

使用道具 举报

结帖率:81% (21/26)

签到天数: 18 天

发表于 2024-3-14 15:24:36 | 显示全部楼层   山东省滨州市
测试结果如下,修改后的文件在最下面

* “D:\Backup\Downloads\新建文件夹 2\”
* “1
00:00:01,650 --> 00:00:03,690
- In tsfsdg vwer, you're gsdfs tcxv asdfs fsdf csdf AADAS trgd.

2
00:00:03,690 --> 00:00:25,890
I'll ssdf abcd caba gvbng uyuyu iasdadqw basds ortrt tfdfad psfdsrew, aaa tzcs tsdf csdfwe tsdfs ysdfew ssdfhyt mqwew puikui isfs a fsdfwe wsdfwe, tsdfwe csdfwe tsdfwe tsdfwe csdfwe tsdfew asdfe hsdfs isdfew asdf tsdfwe psdfwe, asdf tsdfwe tsdf ssdfe csdfew tsdfew isdfew psdfew dsdfew asfew vwerw lwerw twerew, asdfew wewa tdsfwe wsdfew ysd ssdfwe ewerwe asfs dwerew osdfwe ysdfwe psdfew asdfew oqtrrthf asdf fgere wddvcw.

3
00:00:25,890 --> 00:00:26,723
Ssdfewrwe gxcvw?

4
00:00:26,723 --> 00:00:28,380
Lsadqw gzct stawerewrd wwertg txvsd sdfwe twerwe.

5
00:00:28,380 --> 00:00:30,570
Asdfwe rsdfw, thsdfew fsdfe txew iswerw cxvew Tysdfwe.

6
00:00:30,570 --> 00:00:36,840
Iwer awewe yosdfsu tqqweos ccvfgt yiuoiu tuikgh ifhrt trtyr stvbe prerw vwerewt lewrtwer ywerw scvgre rqweq hvert.

7
00:00:36,840 --> 00:00:45,390
Socfew wewer ycgv txcvew txcf pxfew youwerwr pvreert osdfr servrewtdice, simdgwqdsply enewhrtter ygfhourwdsf tesferewsxt inwrwerto Tvwwrwsf' form, ansfewrd thiuoity ofhrtt cofhrrts a viretetedeo icvwen secoeretdfnds.


被调试易程序运行完毕

合并 .e (693.99 KB, 下载次数: 0)
回复

使用道具 举报

结帖率:81% (21/26)

签到天数: 18 天

发表于 2024-3-14 15:25:41 | 显示全部楼层   山东省滨州市
合并 .e (693.99 KB, 下载次数: 0)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 致发广告者

发布主题 收藏帖子 返回列表

sitemap| 易语言源码| 易语言教程| 易语言论坛| 诚聘英才| 易语言模块| 手机版| 广告投放| 精易论坛
拒绝任何人以任何形式在本论坛发表与中华人民共和国法律相抵触的言论,本站内容均为会员发表,并不代表精易立场!
论坛帖子内容仅用于技术交流学习和研究的目的,严禁用于非法目的,否则造成一切后果自负!如帖子内容侵害到你的权益,请联系我们!
防范网络诈骗,远离网络犯罪 违法和不良信息举报电话0663-3422125,QQ: 800073686,邮箱:800073686@b.qq.com
Powered by Discuz! X3.4 揭阳市揭东区精易科技有限公司 ( 粤ICP备12094385号-1) 粤公网安备 44522102000125 增值电信业务经营许可证 粤B2-20192173

快速回复 返回顶部 返回列表