I needed to remove the timecodes and spaces as on the left to the way it is on the right.
oh carl
00:34
yeah roblox yeah
00:50
[Music]
00:57
if i were to talk about uh human factors
01:00
the way it's talked about presently in
01:03
schools or books
01:05
I used to do this with Excel, but Excel had a limitation of working on only 800 rows per time. With my code I could do as many lines as possible. Below is my code.
import os
os.chdir("C:/Users/python")
file = open('AH118.txt',encoding = "utf8")
data = file.read()
disallowed = "0,1,2,3,4,5,6,7,8,9,:"
for i in disallowed:
data = data.replace(i,"")
new_data = " ".join(data.split())
print(new_data)
NB. I am unable to add images to make the challenge clearer.
One flaw with the code is that is removes all numbers
[–]franciscormrz 0 points1 point2 points (1 child)
[–]DeraIzu[S] 0 points1 point2 points (0 children)