Filtering Findstr results

Home Forums Scripting General Scripting Filtering Findstr results

Viewing 1 post (of 1 total)
  • Author
    Posts

  • chrispage
    Member
    #167424

    I am trying to extract the last word of a findstr results query

    The command I run
    findstr /i %1 x:itlogswho_when.txt | findstr /i %2[/CODE]
    the results I get
    [CODE]12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word [I][B]B0K9VY1 [/B][/I]so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)[CODE]findstr /i %1 x:itlogswho_when.txt | findstr /i %2[/CODE]
    the results I get
    12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word [I][B]B0K9VY1 [/B][/I]so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)[CODE]12/02/2018 10:17:58 SmithS Steve Smith B0K9VY1
    13/02/2018 09:29:13 SmithS Steve Smith B0K9VY1[/CODE]
    What i need from the results is that last word B0K9VY1 so i can run SCCM RemoteControl $computername

    (it will *always* be the last word on the last line of the results from my findstr query)

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

The World’s Most Comprehensive Teams to Teams Migration Checklist

Whether you have just started thinking about migration or have already begun to move, our Microsoft Teams Migration Checklist can help guide you through the different phases for a Teams migration to another tenant.

This detailed six-step guide will walk you through key decision points while also providing more prescriptive best practice recommendations where appropriate.

Discover key insights for the following phases of a Teams migration: 

  • Discovery
  • Pilot
  • Planning
  • Communication
  • Execution
  • Validation

Sponsored by: