You have a text file, which looks like it’s space delimited?
computer1 rob laptop
computer3 john desktop
computer4 sam laptop
You would want to define the header row by creating a PSObject and as Don says above, Export-CSV. There are multiple ways to do things, but without seeing the file all we can do is provide an example:
#Grab the text file
$textFile = Get-Content 'C:\Users\rsimmers\Desktop\test.txt'
#Loop through each line and assign everything produced in the
$result = foreach ($line in $textFile) {
#Split the line into an array using space as a delimiter
$array = $line -Split " "
#Create a new object to return to $result and define the what each "column" would be assigned to
New-Object -TypeName PSObject -Property @{ComputerName=$array[0];Owner=$array[1];Type=$array[2]}
}
#Export the object to a CSV
$result | Export-CSV C:\Test\MyCSV.csv -NoTypeInformation