Hi,
How can we extract table data from xml using regex or any other approach.
I have a sample table in below format in screenshot.need that into a datatable.
Hi,
How can we extract table data from xml using regex or any other approach.
I have a sample table in below format in screenshot.need that into a datatable.
Hey you can try reffering the video :- UiPath | Convert HTML String To DataTable using LINQ query | HTML To Table | LINQ Tutorials - YouTube or use this activity from market place - HTML to DataTable - RPA Component | UiPath Marketplace | Overview
can you try this
First build a datatable using build datatable activity for your output value
Read the xml and deserialize that xml data using deserialize xml activity
Use for each to iterate deserialized xml data and set type argument as System.Xml.Linq.Xelement
Then pass the in argument value as deserializedvariable.Descendats("enter the parent tag name of desired tag ")
Finally use add data row activity inside the for activity to add values into datatable pass the xml data into array like {item.Element(“your desired tag name 1”).value,item.Element(“your desired tag name 2”).value} and pass the build datatable output variable into datatable tab
We converted xml data into datatable
in general we can use XML Processing concepts, when html is Xhtml
for HTML which is not XML conform we can use: https://html-agility-pack.net/
a technolgy more close / intended approach is to prefer compared to text oriented RegEx
Along with a small transformation we can also exploit:
Open it in a browser and use the Table Extraction wizard.