Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

How would you convert the following .SRT file's contents into plain text via DOS command?

How would you convert the following .SRT file's contents into plain text stripping out the
line number and time information lines using DOS?

I have attached a .SRT file with the following contents:

I was hoping to convert the following .SRT file's contents from

6
00:00:27,000 --> 00:00:30,000
and build some simple webpages.

7
00:00:30,000 --> 00:00:33,000
Part of what makes web design and web development so fun

8
00:00:33,000 --> 00:00:37,000
when compared to other forms of software development, is that you can

to revised values as follows:

and build some simple webpages.
Part of what makes web design and web development so fun
when compared to other forms of software development, is that you can
TEST.txt
ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zimmer9

ASKER

may I ask how you can redirect the output to another file, for ex: TESTOUT.txt
Avatar of zimmer9

ASKER

The numbers still appear in the output. For ex:

6
and build some simple webpages.

7
Part of what makes web design and web development so fun

8
when compared to other forms of software development, is that you can
Redirection to another output is shown above (> TEST_stripped.txt).

My output is this:

C:\Temp>type test.txt
6
00:00:27,000 --> 00:00:30,000
and build some simple webpages.

7
00:00:30,000 --> 00:00:33,000
Part of what makes web design and web development so fun

8
00:00:33,000 --> 00:00:37,000
when compared to other forms of software development, is that you can
C:\Temp>findstr /v /r "^$ --> ^[0-9]*$" test.txt > test_stripped.txt

C:\Temp>type test_stripped.txt
and build some simple webpages.
Part of what makes web design and web development so fun
when compared to other forms of software development, is that you can
C:\Temp>

Open in new window


test_stripped.txt has the output you requested, without the numbered lines and without the empty lines.

Did you copy/paste the findstr pattern correctly? There are (important) spaces in there, these are required.