I have a CSV file, which reads like this:
read, book
read1, book1
read2, book2
I want to read only the first value, before comma one line at time,
meaning first time it will be
read
read1
read2
no headers and i want to pass that value to a variable for a if condition.
I have script it read line by line but it reads both values before coma and after line by line, so instead of having three values i'm ending with 6 values.
$file = Import-CSV c:\script\server.csv$file | ForEach-Object {
foreach ($property in $_.PSObject.Properties)
{
$property.Name
$property.Value
#replace = $property.Value
}
}