`calibredb list` has a --for-machine option that will output JSON, which is going to be your best option for scripting.
The default, human-readable output shapes itself to the output terminal and isn't meant to be programmatically parsed.
Any decent programming language should have a way to parse JSON.
For bash, you will have to use something like
jshon.