Cleaning messy PDF report

csenor

Board Regular
Joined
Apr 10, 2013
Messages
169
Office Version
  1. 365
Platform
  1. Windows
I have a report layout that I've never seen before that I need help getting into a cleaner table format in Excel. The report has four fields. Employee ID, First Name, Last Name, Date of Birth. Can someone help me through the process? Here is an example.
EmployeeID : DOE0001First Name : JOHN
Last Name : DoeDOB : 1/1/1980
Employee ID : SMITH0001First Name : MIKE
Last Name : SmithDOB : 12/15/1985
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
What do you want the end result to look like? Mind reading is tough these days. :)
 
Upvote 0
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="tblPDF"]}[Content],
    Split1 = Table.SplitColumn(Source, "Column1", Splitter.SplitTextByDelimiter(" : ", QuoteStyle.Csv), {"a", "b"}),
    Split2 = Table.SplitColumn(Split1, "Column2", Splitter.SplitTextByDelimiter(" : ", QuoteStyle.Csv), {"c", "d"}),
    AddIndex = Table.AddIndexColumn(Split2, "Index", 0, 1, Int64.Type),
    lst = List.Accumulate(Table.ToRows(AddIndex), {}, (s,c)=> 
            if Number.IsEven(c{4}) then s & List.FirstN(c,4) & List.FirstN(Record.ToList(AddIndex{c{4}+1}),4) else s),
    Result = Table.FromRows(List.Split(List.Alternate(lst, 1, 1,0),4),List.Distinct(List.Alternate(lst, 1, 1,1)))
in
    Result

Book2
ABCDEFGH
1tblPDFQuery Output
2Column1Column2Employee IDFirst NameLast NameDOB
3Employee ID : DOE0001First Name : JOHNDOE0001JOHNDoe1/1/1980
4Last Name : DoeDOB : 1/1/1980SMITH0001MIKESmith12/15/1985
5Employee ID : SMITH0001First Name : MIKE
6Last Name : SmithDOB : 12/15/1985
7
Sheet2
 
Upvote 0

Forum statistics

Threads
1,223,361
Messages
6,171,632
Members
452,411
Latest member
sprichwort

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top