Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parsing Text File
#1
I am trying to figure out how to parse some text from a text file and store the results as ordered pairs for a Word document. Using PyPDF2, print(pdfReader.outlines), I can get a listing of the bookmarks. Each bookmark bares a medical record source and a date range for the medical records in the bookmark. I want to create a Word document merge to order medical records from the source AFTER the date range listed in the bookmark and to the present. Here's an example of the sting I want to parse:

{'/Title': '3F: Hospital Records (HOSPITAL) Src.: Parkland Memorial Hospital Tmt. Dt.: 06/11/2015 - 06/14/2015 (27 pages)', '/Type': '/FitB', '/Page': IndirectObject(1264, 0)}

So for this string I want to Pull the name "Parkland Memorial Hospital" and the last date (6/14/2015) To make it a little more trick my target text will be numberF. And the target text is just after the FIRST appearance of the numberF in the text file. So for Exhibit 1F, my target text is just after the first appearance of 1F, and so on. I am new to this and really struggling. Thanks so much.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Text parsing Arik 5 407 Mar-11-2024, 03:30 PM
Last Post: Gribouillis
Video doing data treatment on a file import-parsing a variable EmBeck87 15 2,894 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 1,128 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Modify values in XML file by data from text file (without parsing) Paqqno 2 1,680 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Parsing xml file deletes whitespaces. How to avoid it? Paqqno 0 1,043 Apr-01-2022, 10:20 PM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 6,999 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  Parsing a syslog file ebolisa 11 4,147 Oct-10-2021, 05:15 PM
Last Post: snippsat
Thumbs Up Parsing a YAML file without changing the string content..?, Flask - solved. SpongeB0B 2 2,280 Aug-05-2021, 08:02 AM
Last Post: SpongeB0B
  [split] How to convert the CSV text file into a txt file Pinto94 5 3,362 Dec-23-2020, 08:04 AM
Last Post: ndc85430
  Saving text file with a click: valueerror i/o operation on closed file vizier87 5 4,407 Nov-16-2020, 07:56 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

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