Solved

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

Posted on 2013-05-28
4
527 Views
Last Modified: 2013-05-29
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
0
Comment
Question by:zimmer9
  • 2
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
Gerwin Jansen earned 500 total points
ID: 39202701
Can you try this:

findstr /v /r "[0-9] ^$" TEST.txt

note that lines containing both text and numbers would get filtered as well.

<edit>

This should do the trick:

findstr /v /r "^$ --> ^[0-9]*$" TEST.txt > TEST_stripped.txt
0
 

Author Comment

by:zimmer9
ID: 39202774
may I ask how you can redirect the output to another file, for ex: TESTOUT.txt
0
 

Author Comment

by:zimmer9
ID: 39202786
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
0
 
LVL 37

Expert Comment

by:Gerwin Jansen
ID: 39203968
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.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now