中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-10 09:01
47,811 topics / 349,897 posts / today 0 new / 48,255 members
DOS批处理 & 脚本技术(批处理室) » Solved Help, how to use a batch file to transform a text file into the following format
Printable Version  789 / 10
Floor1 kaikai163 Posted 2008-11-08 17:58
初级用户 Posts 60 Credits 107
There are two documents

The first one is as follows:
Title: The Million Pound Note
Once upon a time when Britain was very rich There was once a time when Britain was very rich
deep in the box of bank in England in the huge vault of the Bank of England
there was more gold than anywhere in the world more gold was stored there than anywhere else in the world

The second one:
00:22.36 --> 01:16.16 Title: The Million Pound Note
01:16.16 --> 01:19.48 Once upon a time when Britain was very rich There was once a time when Britain was very rich


In the second document, the number after the arrow is the number from the next line


How can I convert it?

I'm a newbie, please enlighten me, experts!Solved

[ Last edited by kaikai163 on 2008-11-8 at 23:12 ]
Floor2 tireless Posted 2008-11-08 18:13
银牌会员 Posts 1,122 Credits 2,025
In the second document, the number after the arrow is the number from the second line

What do you mean?
Floor3 pusofalse Posted 2008-11-08 18:39
银牌会员 Posts 646 Credits 1,604


Also, the OP didn't explain clearly how the last line should be displayed...
Floor4 slore Posted 2008-11-08 18:42
铂金会员 Posts 2,478 Credits 5,212
Subtitle file processing...
Floor5 kaikai163 Posted 2008-11-08 22:23
初级用户 Posts 60 Credits 107
The poster in reply #4 is a real expert! That's exactly what I need!

But now I've found a piece of software that can convert it, that is, convert lrc to srt, but there are quite a few blank lines in it

It looks like this

4
00:01:19,489 --> 00:01:21,480
deep in the box of bank in England in the huge vault of the Bank of England

5
00:01:21,489 --> 00:01:27,160
there was more gold than anywhere in the world more gold was stored there than anywhere else in the world

6
00:01:27,169 --> 00:01:27,720
safe the banks of England. back then, reputable people often said


How can I remove the numbers and blank lines, and put the subtitles and time on one line??

Still asking all you experts to kindly give me some advice!
Floor6 kaikai163 Posted 2008-11-08 22:27
初级用户 Posts 60 Credits 107
Dizzy... by not paying attention I gave points to reply #2, I originally wanted to give them to the big brother in reply #3!
Floor7 HAT Posted 2008-11-08 22:32
版主 Posts 5,017 Credits 9,023
Floor8 kaikai163 Posted 2008-11-08 22:59
初级用户 Posts 60 Credits 107
Moderator, you're practically a god, I admire you so much!

But I still have one tiny little request

00:02:21,169 --> 00:02:23,120 A bet is for making a bet

00:02:23,129 --> 00:02:26,240 Making a bet, you mean making a bet


Moderator, can you tell why the space before “A bet is for making a bet” on the first line is so wide?

Then please modify your batch file a bit so that the second line also has a space like that added in front of it.

Sorry to trouble you!
Floor9 HAT Posted 2008-11-08 23:02
版主 Posts 5,017 Credits 9,023
In the code in reply #7, change this yourself:
set line=!line! %%i
Try replacing the space between !line! and %%i with a tab
Floor10 kaikai163 Posted 2008-11-08 23:03
初级用户 Posts 60 Credits 107
Originally posted by HAT at 2008-11-8 11:02 PM:
In the code in reply #7, change this yourself:
set line=!line! %%i
Try replacing the space between !line! and %%i with a tab


Okay, I'll try it!
Floor11 kaikai163 Posted 2008-11-08 23:11
初级用户 Posts 60 Credits 107
Success, thanks moderator HAT!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023