Powershell Export-CSV (A custom object full of arrays) RRS feed

  • Question

  • Hello all,

    I've been searching high and low for an answer here, but have come up dry.  I'm hoping someone can help.

    I have a script that pulls data out of a text file.  The end result is that I'm left with 9 arrays of the same length where the individual rows in the array all correspond with one another.  I'm trying to get these arrays into a CSV file for data analysis.  I have created an object and added each array to the object as a NoteProperty.

    When I use the export-csv command, the first row has all of the property names, which is great, but then the following row shows the variable type of each of the arrays, but does not enumerate the items in the array.

    Can I use the export-csv command to do what I want or do I need to do a foreach loop and do it by hand?

    Let me know if more information is needed.


    • Edited by djohnson68 Monday, June 3, 2013 10:31 PM
    • Moved by Bill_Stewart Friday, August 16, 2013 3:01 PM Abandoned thread
    Monday, June 3, 2013 10:31 PM

All replies

  • The simple answer is no, not as you have described it.

    You say you start with a file and it somehow magicall becomes 9 arrays... How is it you are able to do this?

    How are these arrays related?  Are they all the same exact structure? If they are you can just add them all together and export the result.


    Tuesday, June 4, 2013 12:24 AM