Python Forum
Correct data structure for this problem
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correct data structure for this problem
#9
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~
Reply


Messages In This Thread
Correct data structure for this problem - by Wigi - Oct-06-2020, 11:12 AM
RE: Correct data structure for this problem - by Wigi - Oct-06-2020, 08:34 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I add certain elements in this 2d data structure and calculate a mean TheOddCircle 3 1,619 May-27-2022, 09:09 AM
Last Post: paul18fr
  Looking for data/info on a perticular data-proccesing problem. MvGulik 9 4,025 May-01-2021, 07:43 AM
Last Post: MvGulik
  Appropriate data-structure / design for business-day relations (week/month-wise) sx999 2 2,873 Apr-23-2021, 08:09 AM
Last Post: sx999
  what data structure to use? Winfried 4 2,891 Mar-16-2021, 12:11 PM
Last Post: buran
  Yahoo_fin, Pandas: how to convert data table structure in csv file detlefschmitt 14 7,959 Feb-15-2021, 12:58 PM
Last Post: detlefschmitt
  How to use Bunch data structure moish 2 2,993 Dec-24-2020, 06:25 PM
Last Post: deanhystad
  difficulties to chage json data structure using json module in python Sibdar 1 2,125 Apr-03-2020, 06:47 PM
Last Post: micseydel
  File system representation in a data structure Alfalfa 1 2,119 Dec-18-2019, 01:56 AM
Last Post: Alfalfa
  Custom data structure icm63 2 2,593 Mar-27-2019, 02:40 AM
Last Post: icm63
  Nested Data structure question arjunfen 7 4,364 Feb-22-2019, 02:18 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020