Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

The size of a dynamic array is defined at

Answered: 1 week ago