I have a txt file with data in the following structure
Ident
Name
Value A
Value B
Value C
Ident
Name
Value A
Value B
Value C
...
How can I convert this to a csv file in the following structure if I know the amount of columns needed and can ensure that the text file has for all Idents the same amount of values?
Ident;Name;Value A;Value B;Value C;
Ident;Name;Value A;Value B;Value C;
I guess this is very simple but I was not able to find anything. Code language can be any (bash, python etc.)
Let's say you have your text like the one on your question,
You can split all of those cell values into a list. Create a row list according to the column count. And join all the rows on the row list with "\n" character.
Steps
Splitting each cell value and putting them into a list
Creating a function to combine each cell value into a new row
Generating all the rows
Then combine generated rows using join.