Try to search your question here, if you can't find : Ask Any Question Now ?

Extract each line from a cell in the CSV file which has multiple lines

HomeCategory: stackoverflowExtract each line from a cell in the CSV file which has multiple lines
Avatarkundan asked 4 months ago

I have CSV file which has a column name as Users. That column has 3 line one single cell

Example:

DomainUser0
DomainUser1
DomainGroup
$entry = Import-Csv Input.csv | select -First 1 | %{$_.Users}

$user0 = $entry[0]
$user1 = $entry[1]
$group = $entry[2]

I get output as:

PS> Write-Host $user0 

DomainUser0
DomainUser1
DomainGroup

PS> Write-Host $user1

PS> Write-Host $group

I need output like

PS> Write-Host $user0 
DomainUser0

PS> Write-Host $user1
DomainUser1

PS> Write-Host $group
DomainGroup
1 Answers
Best Answer
AvatarMannu answered 4 months ago
Your Answer

5 + 3 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com