I want to change the first character on each line in the text file. Here is my code and my output but I don't know how to change and save that in the same text file.
for rf in glob.glob('./labels/train/*'):
read=open(rf,'r')
t=read.readlines()
for ind in t:
print(ind[0])
I have got what I want but I don't know how to change that and save it in the same text file.
1
1
1
1
1
4