I'm looking to text process an existing file and have the output of the alrorithm output to a new file. I thought it would be an easy task, but it's flummoxing me, probably because I don't know ls from cat from awk at this point.
I have an existing very, very large text file that's formatted as:
00:02:00.100 --> 00:02:00.100
BLAH BLAH BLAH
00:02:00.100 --> 00:02:00.100
BLAH BLAH BLAH
I basically am trying to output a txt file with just
BLAH BLAH BLAH BLAH BLAH BLAH
I can probably create a Word macro to do it as well, and even the all caps I could correct.
So far, I have
cat file.vtt | grep -v [0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9][[:space:]][[:punct:]][[:punct:]][[:punct:]][[:space:]][0-9][0-9]:[0-9][0-9]:[0-9][0-9].[0-9][0-9][0-9]
That outputs on the screen the results and it's definitely removed the timecode stamps, but for the life of me I can't figure out how to remove the hard returns between timecodes and just have the text lines flow.
The existing text file also uses >> to indicate a hard return. Is there some way I could incorpoate that into the string, to insert a carriage return every time >> is in the existing file?
And finally, how in the world do I cause the original xyz.txt to be overrwritten with the output of the string?
>>
and multiple lines and the expected output for that? Use code formatting for the example output, input, and commands, please: askubuntu.com/editing-help#code