Solved

How to fine tune a DOS command to strip out the rows that represent line numbers within a file?

Posted on 2013-05-28
3
327 Views
Last Modified: 2013-05-30
How would you modify the following DOS Command which so far strips out the rows with semi colons, to convert the following file's contents into plain text stripping out the rows with line number using DOS?

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

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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Bill Prew
ID: 39203241
I'm confused about what you want.  I ran that command against you test file and seem to get what you said you are looking for?

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

Open in new window

~bp
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 39204004
Look at my answer in your previous question, I suspect you did not copy/paste the findstr pattern correctly.
0
 
LVL 55

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 39204258
If you want a slightly different means to the same end, you could try:

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

It uses the /v option to select lines NOT matching any of the regex patterns.

The first pattern "^$" eliminates an blank lines.

The second pattern "^[0-9]*$" eliminates any lines with just a number on them.

The third pattern "^[0-9:,]* --> [0-9:,]*$" eliminates the "time stamp" lines with the " --> " on them.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

691 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