For example a file such as:
def player():
Player
9
Mike
M
180
90
6
2
3.81
.283
Would return data such as:
<player>
<number> 9 </number>
<playername> Mike </playername>
<gender> M </gender>
<height> 175 </height>
<weight> 95 </weight>
<wins> 6 </wins>
<losses> 2 </losses>
<era> 3.81 </era>
<batting> .283 </batting>
</player>
If you could give me any info on files to data, I would be greatly appreciative.
My idea is to read each line, split the line by spaces. After that, I will print the element from array with specific tag. You can store tag in a list and the ending tag could be the pair converted to list, and insert ‘/’ on 1 position.