How to extract values between delimiters in a multi-line textfile using PowerShell RRS feed

  • Question

  • I have a large text file written to an array wherein each line contains a part number I am trying to extract.

    The part number can always be found between the second and third colon in each line, simplified example below:


    My attempted code that failed: 

     foreach ($item in $arrayParts) 
    { $partNum = "{0}:{1}:" -f $str.Split(':') }

    Any help appreciated, thanks. JB

    Tuesday, January 5, 2021 9:08 PM