Windows Vista Forums

Remove Member Property?

  1. #1


    Brian Vallelunga Guest

    Remove Member Property?

    Is there something that will let me remove a member from an object?
    For example, I'm importing a CSV using Import-Csv and I'd like to
    remove one of the columns of data before I process the file. Obviously
    I could set the value to null for the column, but I want to remove the
    column of data completely. Any ideas?




      My System SpecsSystem Spec

  2. #2


    Kiron Guest

    Re: Remove Member Property?

    After you import the data to a variable, set the variable to itself minus
    the property:

    $csv = test.csv
    $csv = $csv | select * -exclude <property>

    --
    Kiron


      My System SpecsSystem Spec

  3. #3


    Kiron Guest

    Re: Remove Member Property?

    Oops!

    $csv = import-csv test.csv
    $csv = $csv | select * -exclude <property>

    --
    Kiron


      My System SpecsSystem Spec

  4. #4


    Brian Vallelunga Guest

    Re: Remove Member Property?

    On Sep 9, 7:09 pm, "Kiron" <Ki...@xxxxxx> wrote:

    > Oops!
    >
    > $csv = import-csv test.csv
    > $csv = $csv | select * -exclude <property>
    >
    > --
    > Kiron
    Excellent! Thanks.


      My System SpecsSystem Spec

  5. #5


    Brandon Shell Guest

    Re: Remove Member Property?

    From the opposite side... you can also select the props you want

    $csv = import-csv test.csv
    $csv = $csv | select prop1,prop2,prop3


    "Brian Vallelunga" <brian.vallelunga@xxxxxx> wrote in message
    news:1189381758.653113.241230@xxxxxx

    > On Sep 9, 7:09 pm, "Kiron" <Ki...@xxxxxx> wrote:

    >> Oops!
    >>
    >> $csv = import-csv test.csv
    >> $csv = $csv | select * -exclude <property>
    >>
    >> --
    >> Kiron
    >
    > Excellent! Thanks.
    >

      My System SpecsSystem Spec

Remove Member Property?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add-Member not Adding a member PeterCS PowerShell 3 26 Nov 2008
Set Focus To Specific Property In Property Grid Derek Hart .NET General 10 06 Oct 2008
Use my custom TypeDescriptor to obtains default Value on property inXAML Property Editor of Visual Studio 2008 azerty Avalon 0 14 Apr 2008
Can't remove explorer menu bar after install/remove Live Search Club toolbar Robert Firth Vista General 2 08 Aug 2007
How to remove read-only property of a file? dh PowerShell 4 02 Aug 2007