Get Value between two String

Welcome Forums General PowerShell Q&A Get Value between two String

This topic contains 1 reply, has 2 voices, and was last updated by

1 year, 6 months ago.

  • Author
  • #78373

    Points: 0
    Rank: Member

    Hi everyone!

    I have a CSV file containing multiple lines which look like this: Image (Editor can't display the code the way I need to)
    How do I get only the values from this CSV file?
    My goal is to store all these values in an array...
    This is what I got so far:

    $importPath = "temp.csv"
    $pattern =
    $string = Get-Content $importPath
    $result = [regex]::match($string, $pattern).Groups[1].Value

    This only returns one time the value all the other value1, value2, value n their values get ignored...

  • #78388

    Points: 638
    Helping Hand
    Rank: Major Contributor

    You can use Import-CSV to import csv's as a PSObject:

    $importPath = "temp.csv"
    $csv = Import-CSV -Path $importPath 

The topic ‘Get Value between two String’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort