Sheldon
Sheldon

Reputation: 11

Powershell - parse CSV input with a specifiable delimiter

How can I separate the data below into two columns delimited by semicolon?

GROUPING;SERIAL NUMBER              
-----------------------             
\\SDD\GMRN\CMM\KAYHA;18137521400329 
\\SDD\GMRN\CMM\KAYHA;18225521400335 
\\SDD\GMRN\CMM\KAYHA;18225521400341 

My expected output is:

GROUPING               SERIAL NUMBER              
--------               --------------             
\\SDD\GMRN\CMM\KAYHA   18137521400329 
\\SDD\GMRN\CMM\KAYHA   18225521400335 
\\SDD\GMRN\CMM\KAYHA   18225521400341 

Thanks!

Upvotes: 0

Views: 93

Answers (1)

Sheldon
Sheldon

Reputation: 11

Sharing you the solution I've found:

When importing csv file, use (-Delmiter) :

 $csvfile = Import-Csv -Path $Dialog.FileName -Delimiter ";"

Upvotes: 1

Related Questions