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
320 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
  • 2
3 Comments
 
LVL 51

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 37

Expert Comment

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
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…
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

10 Experts available now in Live!

Get 1:1 Help Now