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 to Expert-Tailored 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

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

The size of a dynamic array is defined at

Answered: 1 week ago

Question

Explain how to reward individual and team performance.

Answered: 1 week ago