- Aug
- 2,840
- 149
I wanted to view a .csv file that has 42 columns.
Using;
...displayed only the first 8 columns of the .csv file,
and the contents of column 8 were truncated.
The solution was to use the -property * argument of format-table,
that ensures every CSV column is included.
Out-String -Width 4096 gives the formatted text enough width to preserve every column.
This allows me to view all 42 columns,
with no truncation of column data.
Ref: Import-Csv (Microsoft.PowerShell.Utility) - PowerShell
Joe
Using;
Code:
pshell /s "Import-Csv -Path .\holdings-report-2026-10-29.csv | format-table" | view
...displayed only the first 8 columns of the .csv file,
and the contents of column 8 were truncated.
The solution was to use the -property * argument of format-table,
that ensures every CSV column is included.
Out-String -Width 4096 gives the formatted text enough width to preserve every column.
This allows me to view all 42 columns,
with no truncation of column data.
Code:
pshell /s "Import-Csv -Path .\holdings-report-2026-10-29.csv | format-table -property * | out-string -width 4096" | view
Ref: Import-Csv (Microsoft.PowerShell.Utility) - PowerShell
Joe