I have Data file that has a regular pattern from which I need to extract information. Each section is seprated by a blank line. Hence I was wondering if I could split the file for processing based in blank lines.
To better explain my problem, let me share the sample structure:
Block: A1
-----------------------------------
Height: 24.00
Width: 0.79
Depth: 0.04
-----------------------------------
Block: A2
-----------------------------------
Height: 20.00
Width: 1.00
Depth: 0.54
-----------------------------------
Block: B1
-----------------------------------
Height: 4.00
Width: 4.50
Depth: 0.87
-----------------------------------
In this Database I need to simplify the report by making multiple columns. The algorithm that I am trying to achieve is that if I can split the file into smaller sections based on blank lines, I could read the database into a two-dimenstional array and finally dump the data into a format of my choice. Hence, the first requirement is to undertand in case I can split the file based on blank lines for further processing.
My expected final result is
A1 A2 B1
Height: 24.00 20.00 4.00
Width: 1.00 4.00 4.50
Depth: 0.04 0.54 0.87
Any suggestions/clues would be appreciated.