I'm converting some csv data to a file format that expects values a certain positions in a line. I thought I'd use format-table to accomplish this by setting the column widths. However, this adds an unwanted extra space between columns. Is there a way to remove the space or are there other formatting options that I could use?
$format =
@{E={$_.lname}; width=30},
@{E={$_.fname}; width=30},
@{E={$_.dob}; width=8},
@{E={if($_.sex -eq 'F') { 'V' } elseif($_.sex -ne 'M') { 'O' } else { $_.sex} }; width=1},
...
@{E={if($_.mstatus -eq 'M') {'Y'} else {'N'}}; width=1;},
@{E={$_.social}; width=50};
import-csv -Delimiter '|' .\data.txt | ft $format -hidetableheaders | out-file -width 2500 'c:\temp\temp.txt'