Thanks, I will investigate Pandas dataframe and see where I end up.
This is the first few lines of the source. The first 2 or 3 characters on every line need to be taken. Some of these ID's define segments, and within a segment, certain ID's mark other regions. I need to grab these, because part of these lines will become a prefix for other lines.
ISA*00* *00* *ZZ*00000000609 *ZZ*1982611190 *200908*0544*{*00501*005440284*1*P*:~
GS*HP*00000000021*1982611190*20200908*0544*13754194*X*005010X221A1~
ST*835*000001075~
BPR*I*12202.7*C*ACH*CCP*01*081517693*DA*00000152302017024*1351840597**01*021000322*DA*2036371219*20200908~
TRN*1*EFT3378768*1351840597~
DTM*405*20200904~
N1*PR*NATIONAL GOVERNMENT SERVICES #13001~
N3*6325 SECURITY BOULEVARD~
N4*BALTIMORE*MD*21207~
PER*CX*NATIONAL GOVERNMENT SERVICES, INC.*TE*8888554356~
PER*BL*EDI HELP DESK*EM*[email protected]*TE*8772734334*EX*5024232356~
N1*PE*MY MEDICAL CENT*XX*1900611190~
N3*PO BOX 15000-7400~
N4*PHILADELPHIA*PA*191957400~
REF*PQ*1982611190~
REF*TJ*112241326~
LX*112012~
TS3*1982611190*11*20201231*6*262918~
TS2*12805.44*12805.44****512.17*****4*11*11***.198~
CLP*2000000001I73748370*22*-102890*-14262.35**MA*22000100197904NYA*11*8**885*-1~
CAS*CO*45*-87219.65~
This is the first few lines of the source. The first 2 or 3 characters on every line need to be taken. Some of these ID's define segments, and within a segment, certain ID's mark other regions. I need to grab these, because part of these lines will become a prefix for other lines.
ISA*00* *00* *ZZ*00000000609 *ZZ*1982611190 *200908*0544*{*00501*005440284*1*P*:~
GS*HP*00000000021*1982611190*20200908*0544*13754194*X*005010X221A1~
ST*835*000001075~
BPR*I*12202.7*C*ACH*CCP*01*081517693*DA*00000152302017024*1351840597**01*021000322*DA*2036371219*20200908~
TRN*1*EFT3378768*1351840597~
DTM*405*20200904~
N1*PR*NATIONAL GOVERNMENT SERVICES #13001~
N3*6325 SECURITY BOULEVARD~
N4*BALTIMORE*MD*21207~
PER*CX*NATIONAL GOVERNMENT SERVICES, INC.*TE*8888554356~
PER*BL*EDI HELP DESK*EM*[email protected]*TE*8772734334*EX*5024232356~
N1*PE*MY MEDICAL CENT*XX*1900611190~
N3*PO BOX 15000-7400~
N4*PHILADELPHIA*PA*191957400~
REF*PQ*1982611190~
REF*TJ*112241326~
LX*112012~
TS3*1982611190*11*20201231*6*262918~
TS2*12805.44*12805.44****512.17*****4*11*11***.198~
CLP*2000000001I73748370*22*-102890*-14262.35**MA*22000100197904NYA*11*8**885*-1~
CAS*CO*45*-87219.65~