It seems a bit difficult to find out how many bitcoins a specific wallet contains.
How does people keep track of it? Manually??
This is clearly XY problem. What are you trying to achieve by reading content of a wallet file?
If you tell us what you're trying to solve or at least what kind of wallet you're trying to read, you'd get clear answer.