I'm trying to convert a .txt file to a csv file using Python. This txt is not conventionnal (at least I have never seen something like that, it's basically like that:
key a: foo
key b: bar
$$$
$$$
key a: foo1
key b: bar1
$$$
$$$
key a: foo2
key b: bar2
I simply want to get the following csv:
foo, bar
foo1, bar1
foo2, bar2
I have no difficulties to do that by simply going through the file as a string and by splitting, but I was wondering if there was a more elegant way to do that using existing libraries for instance. Thanks in advance!