TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 303
- Office Version
- 365
- Platform
- Windows
Hello, I have some backgammon files I'd like to extract the dice rolls from. The files are in an .sgf format (but they open in Notepad++ as readable text files).
Line 1 of each file is a config row so I want to ignore it. But from line 2 onwards, these contain the dice rolls. The lines are always in this format
The dice rolls are stored at position 4 and 5 of each line - so in line one, black rolled a 6 and a 2, in line two white rolled a 3 and a 1.
Can I loop through a folder full of these files and extract the rolls into a worksheet, columns A and B being the two dice rolled by black, columns C and D those by white?
Many thanks for reading.
Line 1 of each file is a config row so I want to ignore it. But from line 2 onwards, these contain the dice rolls. The lines are always in this format
Code:
;B[62agac]A[2][agln E ver 3 0.507860 0.131387 0.005938 0.135761 0.005711 0.015720 2C 0 1 0.000000 1]
;W[31hefe]A[1][fchg E ver 3 0.501876 0.146071 0.005506 0.135889 0.008282 0.003752 2C 0 1 0.000000 1]
The dice rolls are stored at position 4 and 5 of each line - so in line one, black rolled a 6 and a 2, in line two white rolled a 3 and a 1.
Can I loop through a folder full of these files and extract the rolls into a worksheet, columns A and B being the two dice rolled by black, columns C and D those by white?
Many thanks for reading.