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
  parsing a tree of text first the right most aligned blocks of text and so on arvindikchari 2 792 Nov-21-2024, 01:42 AM
Last Post: BashBedlam
  Reading an ASCII text file and parsing data... oradba4u 2 1,448 Jun-08-2024, 12:41 AM
Last Post: oradba4u
  Text parsing Arik 5 1,683 Mar-11-2024, 03:30 PM
Last Post: Gribouillis
Video doing data treatment on a file import-parsing a variable EmBeck87 15 5,697 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 2,034 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  Modify values in XML file by data from text file (without parsing) Paqqno 2 3,172 Apr-13-2022, 06:02 AM
Last Post: Paqqno
  Parsing xml file deletes whitespaces. How to avoid it? Paqqno 0 1,680 Apr-01-2022, 10:20 PM
Last Post: Paqqno
  Converted Pipe Delimited text file to CSV file atomxkai 4 10,998 Feb-11-2022, 12:38 AM
Last Post: atomxkai
  Parsing a syslog file ebolisa 11 6,733 Oct-10-2021, 05:15 PM
Last Post: snippsat
Thumbs Up Parsing a YAML file without changing the string content..?, Flask - solved. SpongeB0B 2 3,092 Aug-05-2021, 08:02 AM
Last Post: SpongeB0B

Forum Jump:

User Panel Messages

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