I am new to DaniWeb. I searched everything to find an answer but i can't. This is for my final project and i need it to get my bachelor degree.
I have a text file that has this type of files:
2001.7.1.407 изутрината во тетовски
2003.5.3.20083 кзк ја штити таканаречен
2001.8.7.1830 винарските визби во македонија и оваа година
I need to separate the number after the second dot ex: 1, 3, 7 and place the text after the last number in a new file which is according to the numbers (note that the numbers are categories from 1-7) so each text has to go in its own text file which will be named by its category.
I hope you understand what i mean...i can't explain it better sorry :(
here is some of the code i wrote(it can be completely wrong):
DB = open('DB.txt', 'r')
kat1 = open('kat1.txt', 'a')
poz = 0
start = DB.find ('2', poz)
if start == -1: break
najdi = DB.find ('.', start)
end = DB.find ('.', najdi)
br = DB[start:najdi:end]
poz = br [br.find('.') + 1]
THANK YOU IN ADVANCE!!!