Filtering data from an html file

Welcome Forums General PowerShell Q&A Filtering data from an html file

  • This topic is empty.
Viewing 0 reply threads
  • Author
    Posts
    • #221370
      Participant
      Topics: 1
      Replies: 0
      Points: -7
      Rank: Member

      Hi all, I’m on day 3 of my Powershell journey and I’m a little bit stuck!

      Long story short, I’m trying to create a way for a launch argument to be made by filtering a html file for id numbers. The user would define the html file, and then the -mod argument would be automatically populated for them.

      $Modhtml= C:\modhtml.html

      Is there a way to go from this:

      <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=450814997">http://steamcommunity.com/sharedfiles/filedetails/?id=450814997</a>
      </td>
      </tr>
      <tr>
      <td>RHSUSAF</td>
      <td>
      <span class="from-steam">Steam</span>
      </td>
      <td>
      <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=843577117">http://steamcommunity.com/sharedfiles/filedetails/?id=843577117</a>
      </td>
      </tr>
      <tr>
      <td>ace</td>
      <td>
      <span class="from-steam">Steam</span>
      </td>
      <td>
      <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=463939057">http://steamcommunity.com/sharedfiles/filedetails/?id=463939057</a><br />

      To This:
      "-Mod=C:\ModDir\450814997;C:\ModDir\843577117;C:\ModDir\463939057;"

      If there’s a way to filter out the id numbers without duplicates, I was looking at doing something like a join-path on a for loop to add the C:\ModDir\ to each returned value.

      Am I on the right track or is there a better way?

      Appreciate the help!

Viewing 0 reply threads
  • You must be logged in to reply to this topic.