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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
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,956
Messages
6,175,614
Members
452,661
Latest member
Nonhle

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