Delete consecutive blanks in a string

Hi

I got a csv file that I want to import.

It looks like

user1            Peter            Parker

user2            John            Doe


The problem is, that there are a lot of blanks between "user1" and "peter" and between "Peter" and "Parker" and so on...

When I run: 

 import-csv "C:\userlist.txt" -Delimiter " " -Encoding Default

Powershell treats every blank as a delimiter. Is there a way to delete all blanks and leave just the first blank as a delimiter?

February 9th, 2015 3:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics