osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Parsing Nested List


On Sunday, February 4, 2018 at 5:06:26 PM UTC-6, Steven D'Aprano wrote:
> On Sun, 04 Feb 2018 14:26:10 -0800, Stanley Denman wrote:
> 
> > I am trying to parse a Python nested list that is the result of the
> > getOutlines() function of module PyPFD2 using pyparsing module.
> 
> pyparsing parses strings, not lists.
> 
> I fear that you have completely misunderstood what pyparsing does: it 
> isn't a general-purpose parser of arbitrary Python objects like lists. 
> Like most parsers (actually, all parsers that I know of...) it takes text 
> as input and produces some sort of machine representation:
> 
> https://en.wikipedia.org/wiki/Parsing#Computer_languages
> 
> 
> So your code is not working because you are calling parseString() with a 
> list argument:
> 
>     myparser.parseString(List)
> 
> 
> The name of the function, parseString(), should have been a hint that it 
> requires a *string* as argument.
> 
> You have generated an outline:
> 
>     List = pdfReader.getOutlines()
> 
> but do you know what the format of that list is? I'm going to assume that 
> it looks something like this:
> 
> ['ABCD 01 of 99', 'EFGH 02 of 99', 'IJKL 03 of 99', ...]
> 
> since that matches the template you gave to pyparsing. Notice that:
> 
> - words are separated by spaces;
> 
> - the first word is any arbitrary word, made up of just letters;
> 
> - followed by EXACTLY two digits;
> 
> - followed by the word "of";
> 
> - followed by EXACTLY two digits.
> 
> Furthermore, I'm assuming it is a simple, non-nested list. If that is not 
> the case, you will need to explain precisely what the format of the 
> outline actually is.
> 
> To parse this list is simple and pyparsing is not required:
> 
> for item in List:
>     words = item.split()
>     if len(words) != 4:
>         raise ValueError('bad input data: %r' % item)
>     first, number, x, total = words
>     number = int(number)
>     assert x == 'of'
>     total = int(total)
>     print(first, number, total)
> 
> 
> 
> 
> Hope this helps.
> 
> (Please keep any replies on the list.)
> 
> 
> 
> -- 
> Steve

Thank you so much Steve.  I do seem to be barking up the wrong tree.  The result of running getOutlines() is indeed a nested list: it is the pdfs bookmarks.  There are 3 levels: level 1 is the section from A-F. When a section there are exhibits, so in Section A we have exhibits 1A to nA. Finally there are bookmarks for individual pages in an exhibit.   So we have this for Section A:

[{'/Title': 'Section A.  Payment Documents/Decisions', '/Page': IndirectObject(1, 0), '/Type': '/FitB'}, [{'/Title': '1A:  Disability Determination Transmittal (831) Dec. Dt.:  05/27/2016 (1 page)', '/Page': IndirectObject(1, 0), '/Type': '/FitB'}, [{'/Title': '1A (Page 1 of 1)', '/Page': IndirectObject(1, 0), '/Type': '/FitB'}], {'/Title': '2A:  Disability Determination Explanation (DDE) Dec. Dt.:  05/27/2016 (10 pages)', '/Page': IndirectObject(6, 0), '/Type': '/FitB'}, [{'/Title': '2A (Page 1 of 10)', '/Page': IndirectObject(6, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 2 of 10)', '/Page': IndirectObject(10, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 3 of 10)', '/Page': IndirectObject(14, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 4 of 10)', '/Page': IndirectObject(18, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 5 of 10)', '/Page': IndirectObject(22, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 6 of 10)', '/Page': IndirectObject(26, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 7 of 10)', '/Page': IndirectObject(30, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 8 of 10)', '/Page': IndirectObject(34, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 9 of 10)', '/Page': IndirectObject(38, 0), '/Type': '/FitB'}, {'/Title': '2A (Page 10 of 10)', '/Page': IndirectObject(42, 0), '/Type': '/FitB'}], {'/Title': '3A:  ALJ Hearing Decision (ALJDEC) Dec. Dt.:  12/17/2012 (22 pages)', '/Page': IndirectObject(47, 0), '/Type': '/FitB'}, [{'/Title': '3A (Page 1 of 22)', '/Page': IndirectObject(47, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 2 of 22)', '/Page': IndirectObject(51, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 3 of 22)', '/Page': IndirectObject(55, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 4 of 22)', '/Page': IndirectObject(59, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 5 of 22)', '/Page': IndirectObject(63, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 6 of 22)', '/Page': IndirectObject(67, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 7 of 22)', '/Page': IndirectObject(71, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 8 of 22)', '/Page': IndirectObject(75, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 9 of 22)', '/Page': IndirectObject(79, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 10 of 22)', '/Page': IndirectObject(83, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 11 of 22)', '/Page': IndirectObject(88, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 12 of 22)', '/Page': IndirectObject(92, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 13 of 22)', '/Page': IndirectObject(96, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 14 of 22)', '/Page': IndirectObject(100, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 15 of 22)', '/Page': IndirectObject(104, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 16 of 22)', '/Page': IndirectObject(108, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 17 of 22)', '/Page': IndirectObject(112, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 18 of 22)', '/Page': IndirectObject(116, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 19 of 22)', '/Page': IndirectObject(120, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 20 of 22)', '/Page': IndirectObject(124, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 21 of 22)', '/Page': IndirectObject(129, 0), '/Type': '/FitB'}, {'/Title': '3A (Page 22 of 22)', '/Page': IndirectObject(133, 0), '/Type': '/FitB'}], {'/Title': '4A:  ALJ Hearing Decision (ALJDEC) Dec. Dt.:  11/12/2015 (24 pages)', '/Page': IndirectObject(137, 0), '/Type': '/FitB'}, [{'/Title': '4A (Page 1 of 24)', '/Page': IndirectObject(137, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 2 of 24)', '/Page': IndirectObject(141, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 3 of 24)', '/Page': IndirectObject(145, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 4 of 24)', '/Page': IndirectObject(149, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 5 of 24)', '/Page': IndirectObject(153, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 6 of 24)', '/Page': IndirectObject(157, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 7 of 24)', '/Page': IndirectObject(161, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 8 of 24)', '/Page': IndirectObject(165, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 9 of 24)', '/Page': IndirectObject(170, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 10 of 24)', '/Page': IndirectObject(174, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 11 of 24)', '/Page': IndirectObject(178, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 12 of 24)', '/Page': IndirectObject(182, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 13 of 24)', '/Page': IndirectObject(186, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 14 of 24)', '/Page': IndirectObject(190, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 15 of 24)', '/Page': IndirectObject(194, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 16 of 24)', '/Page': IndirectObject(198, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 17 of 24)', '/Page': IndirectObject(202, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 18 of 24)', '/Page': IndirectObject(206, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 19 of 24)', '/Page': IndirectObject(211, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 20 of 24)', '/Page': IndirectObject(215, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 21 of 24)', '/Page': IndirectObject(219, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 22 of 24)', '/Page': IndirectObject(223, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 23 of 24)', '/Page': IndirectObject(227, 0), '/Type': '/FitB'}, {'/Title': '4A (Page 24 of 24)', '/Page': IndirectObject(231, 0), '/Type': '/FitB'}]],

This for Section F (I skipped the other sections as Section F is what I am particularly interested in and it is the last section in the List

{'/Title': 'Section F.  Medical Records', '/Page': IndirectObject(838, 0), '/Type': '/FitB'}, [{'/Title': '1F:  HIT MER (HITMER)  Src.:  Kaiser Permanente Tmt. Dt.:  11/21/2014 - 03/17/2016 (85 pages)', '/Page': IndirectObject(838, 0), '/Type': '/FitB'}, [{'/Title': '1F (Page 1 of 85)', '/Page': IndirectObject(838, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 2 of 85)', '/Page': IndirectObject(842, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 3 of 85)', '/Page': IndirectObject(846, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 4 of 85)', '/Page': IndirectObject(850, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 5 of 85)', '/Page': IndirectObject(854, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 6 of 85)', '/Page': IndirectObject(858, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 7 of 85)', '/Page': IndirectObject(862, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 8 of 85)', '/Page': IndirectObject(867, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 9 of 85)', '/Page': IndirectObject(871, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 10 of 85)', '/Page': IndirectObject(875, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 11 of 85)', '/Page': IndirectObject(879, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 12 of 85)', '/Page': IndirectObject(883, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 13 of 85)', '/Page': IndirectObject(887, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 14 of 85)', '/Page': IndirectObject(891, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 15 of 85)', '/Page': IndirectObject(895, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 16 of 85)', '/Page': IndirectObject(899, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 17 of 85)', '/Page': IndirectObject(903, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 18 of 85)', '/Page': IndirectObject(908, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 19 of 85)', '/Page': IndirectObject(912, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 20 of 85)', '/Page': IndirectObject(916, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 21 of 85)', '/Page': IndirectObject(920, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 22 of 85)', '/Page': IndirectObject(924, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 23 of 85)', '/Page': IndirectObject(928, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 24 of 85)', '/Page': IndirectObject(932, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 25 of 85)', '/Page': IndirectObject(936, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 26 of 85)', '/Page': IndirectObject(940, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 27 of 85)', '/Page': IndirectObject(944, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 28 of 85)', '/Page': IndirectObject(949, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 29 of 85)', '/Page': IndirectObject(953, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 30 of 85)', '/Page': IndirectObject(957, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 31 of 85)', '/Page': IndirectObject(961, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 32 of 85)', '/Page': IndirectObject(965, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 33 of 85)', '/Page': IndirectObject(969, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 34 of 85)', '/Page': IndirectObject(973, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 35 of 85)', '/Page': IndirectObject(977, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 36 of 85)', '/Page': IndirectObject(981, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 37 of 85)', '/Page': IndirectObject(985, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 38 of 85)', '/Page': IndirectObject(990, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 39 of 85)', '/Page': IndirectObject(994, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 40 of 85)', '/Page': IndirectObject(998, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 41 of 85)', '/Page': IndirectObject(1002, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 42 of 85)', '/Page': IndirectObject(1006, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 43 of 85)', '/Page': IndirectObject(1010, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 44 of 85)', '/Page': IndirectObject(1014, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 45 of 85)', '/Page': IndirectObject(1018, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 46 of 85)', '/Page': IndirectObject(1022, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 47 of 85)', '/Page': IndirectObject(1026, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 48 of 85)', '/Page': IndirectObject(1031, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 49 of 85)', '/Page': IndirectObject(1035, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 50 of 85)', '/Page': IndirectObject(1039, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 51 of 85)', '/Page': IndirectObject(1043, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 52 of 85)', '/Page': IndirectObject(1047, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 53 of 85)', '/Page': IndirectObject(1051, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 54 of 85)', '/Page': IndirectObject(1055, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 55 of 85)', '/Page': IndirectObject(1059, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 56 of 85)', '/Page': IndirectObject(1063, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 57 of 85)', '/Page': IndirectObject(1067, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 58 of 85)', '/Page': IndirectObject(1072, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 59 of 85)', '/Page': IndirectObject(1076, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 60 of 85)', '/Page': IndirectObject(1080, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 61 of 85)', '/Page': IndirectObject(1084, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 62 of 85)', '/Page': IndirectObject(1088, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 63 of 85)', '/Page': IndirectObject(1092, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 64 of 85)', '/Page': IndirectObject(1096, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 65 of 85)', '/Page': IndirectObject(1100, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 66 of 85)', '/Page': IndirectObject(1104, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 67 of 85)', '/Page': IndirectObject(1108, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 68 of 85)', '/Page': IndirectObject(1113, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 69 of 85)', '/Page': IndirectObject(1117, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 70 of 85)', '/Page': IndirectObject(1121, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 71 of 85)', '/Page': IndirectObject(1125, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 72 of 85)', '/Page': IndirectObject(1129, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 73 of 85)', '/Page': IndirectObject(1133, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 74 of 85)', '/Page': IndirectObject(1137, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 75 of 85)', '/Page': IndirectObject(1141, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 76 of 85)', '/Page': IndirectObject(1145, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 77 of 85)', '/Page': IndirectObject(1149, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 78 of 85)', '/Page': IndirectObject(1154, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 79 of 85)', '/Page': IndirectObject(1158, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 80 of 85)', '/Page': IndirectObject(1162, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 81 of 85)', '/Page': IndirectObject(1166, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 82 of 85)', '/Page': IndirectObject(1170, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 83 of 85)', '/Page': IndirectObject(1174, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 84 of 85)', '/Page': IndirectObject(1178, 0), '/Type': '/FitB'}, {'/Title': '1F (Page 85 of 85)', '/Page': IndirectObject(1182, 0), '/Type': '/FitB'}], {'/Title': '2F:  Office Treatment Records (OFFCREC)  Src.:  MENTAL HEALTH CENTER OF DENVER Tmt. Dt.:  12/22/2015 - 04/14/2016 (76 pages)', '/Page': IndirectObject(1186, 0), '/Type': '/FitB'}, [{'/Title': '2F (Page 1 of 76)', '/Page': IndirectObject(1186, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 2 of 76)', '/Page': IndirectObject(1190, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 3 of 76)', '/Page': IndirectObject(1195, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 4 of 76)', '/Page': IndirectObject(1199, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 5 of 76)', '/Page': IndirectObject(1203, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 6 of 76)', '/Page': IndirectObject(1207, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 7 of 76)', '/Page': IndirectObject(1211, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 8 of 76)', '/Page': IndirectObject(1215, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 9 of 76)', '/Page': IndirectObject(1219, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 10 of 76)', '/Page': IndirectObject(1223, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 11 of 76)', '/Page': IndirectObject(1227, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 12 of 76)', '/Page': IndirectObject(1231, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 13 of 76)', '/Page': IndirectObject(1236, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 14 of 76)', '/Page': IndirectObject(1240, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 15 of 76)', '/Page': IndirectObject(1244, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 16 of 76)', '/Page': IndirectObject(1248, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 17 of 76)', '/Page': IndirectObject(1252, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 18 of 76)', '/Page': IndirectObject(1256, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 19 of 76)', '/Page': IndirectObject(1260, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 20 of 76)', '/Page': IndirectObject(1264, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 21 of 76)', '/Page': IndirectObject(1268, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 22 of 76)', '/Page': IndirectObject(1272, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 23 of 76)', '/Page': IndirectObject(1277, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 24 of 76)', '/Page': IndirectObject(1281, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 25 of 76)', '/Page': IndirectObject(1285, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 26 of 76)', '/Page': IndirectObject(1289, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 27 of 76)', '/Page': IndirectObject(1293, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 28 of 76)', '/Page': IndirectObject(1297, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 29 of 76)', '/Page': IndirectObject(1301, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 30 of 76)', '/Page': IndirectObject(1305, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 31 of 76)', '/Page': IndirectObject(1309, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 32 of 76)', '/Page': IndirectObject(1313, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 33 of 76)', '/Page': IndirectObject(1318, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 34 of 76)', '/Page': IndirectObject(1322, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 35 of 76)', '/Page': IndirectObject(1326, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 36 of 76)', '/Page': IndirectObject(1330, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 37 of 76)', '/Page': IndirectObject(1334, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 38 of 76)', '/Page': IndirectObject(1338, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 39 of 76)', '/Page': IndirectObject(1342, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 40 of 76)', '/Page': IndirectObject(1346, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 41 of 76)', '/Page': IndirectObject(1350, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 42 of 76)', '/Page': IndirectObject(1354, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 43 of 76)', '/Page': IndirectObject(1359, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 44 of 76)', '/Page': IndirectObject(1363, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 45 of 76)', '/Page': IndirectObject(1367, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 46 of 76)', '/Page': IndirectObject(1371, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 47 of 76)', '/Page': IndirectObject(1375, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 48 of 76)', '/Page': IndirectObject(1379, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 49 of 76)', '/Page': IndirectObject(1383, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 50 of 76)', '/Page': IndirectObject(1387, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 51 of 76)', '/Page': IndirectObject(1391, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 52 of 76)', '/Page': IndirectObject(1395, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 53 of 76)', '/Page': IndirectObject(1400, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 54 of 76)', '/Page': IndirectObject(1404, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 55 of 76)', '/Page': IndirectObject(1408, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 56 of 76)', '/Page': IndirectObject(1412, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 57 of 76)', '/Page': IndirectObject(1416, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 58 of 76)', '/Page': IndirectObject(1420, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 59 of 76)', '/Page': IndirectObject(1424, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 60 of 76)', '/Page': IndirectObject(1428, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 61 of 76)', '/Page': IndirectObject(1432, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 62 of 76)', '/Page': IndirectObject(1436, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 63 of 76)', '/Page': IndirectObject(1441, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 64 of 76)', '/Page': IndirectObject(1445, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 65 of 76)', '/Page': IndirectObject(1449, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 66 of 76)', '/Page': IndirectObject(1453, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 67 of 76)', '/Page': IndirectObject(1457, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 68 of 76)', '/Page': IndirectObject(1461, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 69 of 76)', '/Page': IndirectObject(1465, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 70 of 76)', '/Page': IndirectObject(1469, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 71 of 76)', '/Page': IndirectObject(1473, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 72 of 76)', '/Page': IndirectObject(1477, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 73 of 76)', '/Page': IndirectObject(1482, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 74 of 76)', '/Page': IndirectObject(1486, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 75 of 76)', '/Page': IndirectObject(1490, 0), '/Type': '/FitB'}, {'/Title': '2F (Page 76 of 76)', '/Page': IndirectObject(1494, 0), '/Type': '/FitB'}], {'/Title': '3F:  Medical Evidence of Record (MER)  Src.:  Parkland Memorial Hospital Tmt. Dt.:  03/17/2017 - 07/25/2017 (19 pages)', '/Page': IndirectObject(1498, 0), '/Type': '/FitB'}, [{'/Title': '3F (Page 1 of 19)', '/Page': IndirectObject(1498, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 2 of 19)', '/Page': IndirectObject(1502, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 3 of 19)', '/Page': IndirectObject(1506, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 4 of 19)', '/Page': IndirectObject(1510, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 5 of 19)', '/Page': IndirectObject(1514, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 6 of 19)', '/Page': IndirectObject(1518, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 7 of 19)', '/Page': IndirectObject(1523, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 8 of 19)', '/Page': IndirectObject(1527, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 9 of 19)', '/Page': IndirectObject(1531, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 10 of 19)', '/Page': IndirectObject(1535, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 11 of 19)', '/Page': IndirectObject(1539, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 12 of 19)', '/Page': IndirectObject(1543, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 13 of 19)', '/Page': IndirectObject(1547, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 14 of 19)', '/Page': IndirectObject(1551, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 15 of 19)', '/Page': IndirectObject(1555, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 16 of 19)', '/Page': IndirectObject(1559, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 17 of 19)', '/Page': IndirectObject(1564, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 18 of 19)', '/Page': IndirectObject(1568, 0), '/Type': '/FitB'}, {'/Title': '3F (Page 19 of 19)', '/Page': IndirectObject(1572, 0), '/Type': '/FitB'}]]]

I am seeking to capture the text at the beginning of each section F exhibit such that I have ordered pairs.  In this case Exhibit 1F would be "Kaiser Permanente", the treating source, and "11/21/2014 - 03/17/2016", the date range. 

Thank you SO MUCH for your help.