Answered step by step
Verified Expert Solution
Question
1 Approved Answer
trying to replace a node with a word that doesnt match with the other nodes. not supposed to the know the word in replacing. very
trying to replace a node with a word that doesnt match with the other nodes. not supposed to the know the word in replacing. very close but need help. its powershell
Copy-Item d:\animals.xml -Destination D:\\pig.xml
[xml]$XML = [System.Xml.XmlDocument](Get-Content (Resolve-Path"D:\pig.xml"))
Foreach($Value in Select-Xml $XML -XPath '//Description'| %{$_.Node.'#text'})
{
If($Value -match 'Corn')
{
continue
}
else
{
$Value -replace '\w+ (\w+)' , 'corn'
}
}
Output= System.Xml.XmlDocument
i need help and i would love for the code advice to be similar to what i have. thanks!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started