How to remove all tabs and break lines of XML file in data factory?
Vieira Dias, Leonor
20
Reputation points
Hello,
I have an XML file and would like to combine all the lines of code into a single one. Manually, this is the equivalent of placing your mouse at the end of each line and pressing "delete" to join the next line to the current one. I tried using the Derived Column but it does not apply since I do not have columns and the file comes from the user therefore it will be different every time.
Once everything is combined in a single line, I want to find every time the word "name" appears and break the line there.
Example input:
<animals>
<animal>
<name>Lion</name>
<species>Panthera leo</species>
<habitat>Savannah</habitat>
</animal>
<animal>
<name>Elephant</name>
<species>Loxodonta africana</species>
<habitat>African Plains</habitat>
</animal>
<animal>
<name>Tiger</name>
<species>Panthera tigris</species>
<habitat>Forest</habitat>
</animal>
</animals>
Output first stage:
<animals><animal><name>Lion</name><species>Panthera leo</species><habitat>Savannah</habitat></animal><animal><name>Elephant</name><species>Loxodonta africana</species><habitat>African Plains</habitat></animal><animal><name>Tiger</name><species>Panthera tigris</species><habitat>Forest</habitat></animal></animals>
Final output
<animals><animal>
<name>Lion</name><species>Panthera leo</species><habitat>Savannah</habitat></animal><animal>
<name>Elephant</name><species>Loxodonta africana</species><habitat>African Plains</habitat></animal><animal>
<name>Tiger</name><species>Panthera tigris</species><habitat>Forest</habitat></animal></animals>
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
1,455 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,640 questions
Developer technologies | XAML
857 questions
Sign in to answer