Forum Discussion
JrBIAnalyst
4 years agoFrequent Visitor
Getting HTML data adjacent to a table (Table title/caption)
I'm working with a data reporting platform that provides outputs as HTML documents. I'd like to import those documents into Power BI to work with the data. Each document has a series of forms and...
- 4 years ago
Hi JrBIAnalyst
Open the file as text, filter for the titles then extract between delimiters to remove any html.
let Source = Table.FromColumns({Lines.FromBinary(File.Contents("d:\temp\forms.htm"), null, null, 1252)}), #"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Column1], "miniTitle") or Text.Contains([Column1], "<hr>")), #"Extracted Text Between Delimiters" = Table.TransformColumns(#"Filtered Rows", {{"Column1", each Text.BetweenDelimiters(_, ">", "<"), type text}}) in #"Extracted Text Between Delimiters"regards
Phil
PhilipTreacy
Super User
4 years agoHi JrBIAnalyst
Open the file as text, filter for the titles then extract between delimiters to remove any html.
let
Source = Table.FromColumns({Lines.FromBinary(File.Contents("d:\temp\forms.htm"), null, null, 1252)}),
#"Filtered Rows" = Table.SelectRows(Source, each Text.Contains([Column1], "miniTitle") or Text.Contains([Column1], "<hr>")),
#"Extracted Text Between Delimiters" = Table.TransformColumns(#"Filtered Rows", {{"Column1", each Text.BetweenDelimiters(_, ">", "<"), type text}})
in
#"Extracted Text Between Delimiters"
regards
Phil