Hello, I'm trying to take a text file with data in the following format. The data begins like this:
OGRID: [373075] XTO PERMIAN OPERATING LLC.
Reference ID: fAPP2226958316
Reference Period: 202301
Days Reported: 18
Total Flared: 14,355 MCF
Total Vented: 0 MCF
OGRID: [373075] XTO PERMIAN OPERATING LLC.
Reference ID: fAPP2126356070
Reference Period: 202301
Days Reported: 4
Total Flared: 6,570 MCF
Total Vented: 0 MCF
The data repeats this format for about 1800 lines. I would like to use the repeating characters before the colon (OGRID, Reference ID, Reference Period, Days Reported, Total Flared, Total Vented) as column names and then place all the data behind the colon in the appropriate columns, so it looks like this:
I have been able to separate the data by splitting the column using the colon as delimiter, but after that I'm stuck. I've tried Transform and Pivot Column, but if I tell it not to aggregate I get an error. I would appreciate any help I can get. Thank you!
OGRID: [373075] XTO PERMIAN OPERATING LLC.
Reference ID: fAPP2226958316
Reference Period: 202301
Days Reported: 18
Total Flared: 14,355 MCF
Total Vented: 0 MCF
OGRID: [373075] XTO PERMIAN OPERATING LLC.
Reference ID: fAPP2126356070
Reference Period: 202301
Days Reported: 4
Total Flared: 6,570 MCF
Total Vented: 0 MCF
The data repeats this format for about 1800 lines. I would like to use the repeating characters before the colon (OGRID, Reference ID, Reference Period, Days Reported, Total Flared, Total Vented) as column names and then place all the data behind the colon in the appropriate columns, so it looks like this:
OGRID | Reference ID | Reference Period | Days Reported | Total Flared | Total Vented |
[373075] XTO PERMIAN OPERATING LLC. | fAPP2226958316 | 202301 | 18 | 14,355 MCF | 0 MCF |
[373075] XTO PERMIAN OPERATING LLC. | fAPP2126356070 | 202301 | 4 | 6,570 MCF | 0 MCF |
I have been able to separate the data by splitting the column using the colon as delimiter, but after that I'm stuck. I've tried Transform and Pivot Column, but if I tell it not to aggregate I get an error. I would appreciate any help I can get. Thank you!