+ 3
Javascript challenge. Video Caption to simple Text
Hi, Everyone I came up with a problem, I'm not ready to do it by my self. So, I thought that maybe it could be useful to some one else, as practice. I downloaded a Youtube caption with this format: mm:ssSome text Ex: 20:00This is a line of caption 20:12This is another line 20:18This is a third line 20:21a fourth line to be sure and so on... I want to keep only the text, without the time at the beginning. To make it more difficult. the time before the 10 minutes has only one digit: 8:45 9:30 9:55 10:03 10:30 11:55 I wouldn't even know where to start. XD Good luck, and thanks.
4 ответов
+ 20
JS is not the best choice for this - you'll need to run it on node to be able to handle files. Otherwise here is a pseudocode:
numbers=[1,2,3,4,5,6,7,8,9,:] // use chars
openfile ();
while not endOfFile{
line = readline ();
while numbers.indexOf( line [0] ) !== -1
line = line.substr (1); // delete the first char
writeToFile ();
}
+ 9
I wonder if what Gonzalo is saying can even be done...
+ 5
in addition to nikolay
also by
1) setting : as reference and maninpulate from that
2) by regex
+ 1
hi. please I know I am not supposed to ask here but please I don't get the question, am still a learner .my question is -would this code be implemented in the browser console and debugger?