# problem with mixing output columns using export-csv

**URL:** <https://forums.powershell.org/t/problem-with-mixing-output-columns-using-export-csv/637>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/problem-with-mixing-output-columns-using-export-csv/637 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/problem-with-mixing-output-columns-using-export-csv/637/1 "2011-12-31T18:30:00Z")

</div>

by willbs at 2013-02-22 13:49:09

> i am running powershell 3  
> i am running a test and the results go to a csv file  
>   
> the output of my first test has 3 columns  
>   
> "`nTest Number `tTest Title `tTest Results" | out-file -filepath C:\TestReport.csv -append   
> then i fill in the columns with the test results  
>   
> then i run the second test, the output of the second test is this code whis has 2 columns  
>   
> Get-Process | Select-Object name, fileversion | export-csv -path C:\TestReport.csv -notype -append -force  
>   
> i get this error  
>   
> export-csv : Cannot process argument because the value of argument "name" is not valid. Change the value of the "name" argument and run the operation again.  
> At C:\Users\xxxxx\Documents\PowerShell\PS\_Check\_Process\_Version.ps1:4 char:49  
> + Get-Process | Select-Object name, fileversion | export-csv -path C:\TestReport.c …  
> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
> + CategoryInfo : InvalidArgument: (🙂 [Export-Csv], PSArgumentException  
> + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.ExportCsvCommand  
>   
> if i switch the test order then the 3 columns are placed in the first column  
>   
> which ever test is run first always appears correctly, it’s the second test that looks like crap or i get an error  
>   
> is there a way to clear or reset things so i can append mixed outputs to the same csv file?  
>   
> thanks in advance

by mjolinor at 2013-02-22 21:48:26

> Powershell won’t let you do that, for good reason. Having rows with different numbers of fields and disparate data in the same file essentially renders it "broken" as a .csv file.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 9:02pm UTC](https://forums.powershell.org/t/problem-with-mixing-output-columns-using-export-csv/637/2 "2024-05-16T21:02:27Z")

</div>


