This is a part of a bookmark file to explain on:
the spaces in the 2nd and 3rd are one "tab" not a space
Code: Select all
UK/1,Black,notBold,notItalic,closed,TopLeftZoom,1,0,0.0
KPI1/1,Black,notBold,notItalic,open,TopLeftZoom,238,8,0.0
KPI2/1,Black,notBold,notItalic,open,TopLeftZoom,349,8,0.0
The first line we will call it the parent line, and the 2nd and 3rd lines is child lines now i managed to make a batch that loop throw the bookmark file and based on the first 2 letters "the country, US,..etc" it make a file named with that name and copy that line to it.
but, I'm stuck in how to make a code that loop throw the bookmark file and when it find a child line "the child line will always start with "tab then KPI" it go to the previous line to see if it is parent line or not,
If it finds that the previous line is a parent line it copy the child line to the file named with the first 2 letters of that parent line "UK",
but if it isn't a parent line it go back another line to check if it is a parent line or not, so it keep going back till it find the first parent line and then it copy that child line to the file named based on the first 2 letters of the parent line
I hope i explained that well,and If possible just need the code to work on that example.
Edit: just to clearify the Parent line won't start with "KPI" " If we ignored the 'TAB' " But the Child Line will
Thanks