title: Read values from excel and replace them in another file using Powershell
body: <p>I need to find a way so that I can read values from an excel file and then replace all the corresponding values in another file accordingly. Basically, I found some discrepancy in one of the automated task we run and I need to convert some values within the file before I send it to the automated task. I have an excel file that list the "wrong" values and their corresponding "correct" values and I need to how Power shell can help me in this.</p>
  
  <pre><code>$docID = $args[0] $docid #Read Z ticker file
  $Zfile = 'I:\IS\Rishabh\Z tickers Active.xls' # Find the .rps file imported automatically from schwab trust
  $RPSFile= 'L:\Trading\Schwab Trust\Import\CS&lt;%dmmdd-01yy&gt;.RPS'
  While (Get-Content $ZFile)
  {
      $_-cmatch 'A$','B$'| Set-Variable X-ticker # End Loop
  }
  (Get-Content $RPSfile) | ForEach-Object { $_-replace '%, ' ,'X-ticker' #End Loop }
  Set-Content $RPSFile
  </code></pre>