Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:46:44+00:00 2026-05-15T05:46:44+00:00

I have (yet another) powershell query. I have an array in powershell which i

  • 0

I have (yet another) powershell query. I have an array in powershell which i need to use the remove() and split commands on.

Normally you set an array (or variable) and the above methods exist. On the below $csv2 array both methods are missing, i have checked using the get-member cmd.

How can i go about using remove to get rid of lines with nan. Also how do i split the columns into two different variables. at the moment each element of the array displays one line, for each line i need to convert it into two variables, one for each column.

timestamp Utilization
——— ———–
1276505880 2.0763250000e+00
1276505890 1.7487730000e+00
1276505900 1.6906890000e+00
1276505910 1.7972880000e+00
1276505920 1.8141900000e+00
1276505930 nan
1276505940 nan
1276505950 0.0000000000e+00

$SystemStats = (Get-F5.iControl).SystemStatistics     
$report = "c:\snmp\data" + $gObj + ".csv"

### Allocate a new Query Object and add the inputs needed
$Query = New-Object -TypeName iControl.SystemStatisticsPerformanceStatisticQuery
$Query.object_name = $i
$Query.start_time = $startTime
$Query.end_time = 0
$Query.interval = $interval
$Query.maximum_rows = 0 

### Make method call passing in an array of size one with the specified query
$ReportData = $SystemStats.get_performance_graph_csv_statistics( (,$Query) )

### Allocate a new encoder and turn the byte array into a string
$ASCII = New-Object -TypeName System.Text.ASCIIEncoding
$csvdata = $ASCII.GetString($ReportData[0].statistic_data) 

$csv2 = convertFrom-CSV $csvdata

$csv2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:46:45+00:00Added an answer on May 15, 2026 at 5:46 am

    There is no Remove or Split method on .NET’s Array type, or added by the PowerShell wrapper around an Array instance. This is quite easy to show:

    PS[64bit] E:\> $a = 1,2,3,4,5
    PS[64bit] E:\> $a.GetType()
    
    IsPublic IsSerial Name                                     BaseType
    -------- -------- ----                                     --------
    True     True     Object[]                                 System.Array
    
    
    PS[64bit] E:\> Get-Member -InputObject $a
    
    
       TypeName: System.Object[]
    
    Name           MemberType    Definition
    ----           ----------    ----------
    Count          AliasProperty Count = Length
    Address        Method        System.Object&, mscorlib, Version=2.0.0.0, Culture=neutral, PublicK...
    Clone          Method        System.Object Clone()
    CopyTo         Method        System.Void CopyTo(array array, int index), System.Void CopyTo(arra...
    Equals         Method        bool Equals(System.Object obj)
    Get            Method        System.Object Get(int )
    GetEnumerator  Method        System.Collections.IEnumerator GetEnumerator()
    GetHashCode    Method        int GetHashCode()
    GetLength      Method        int GetLength(int dimension)
    GetLongLength  Method        long GetLongLength(int dimension)
    GetLowerBound  Method        int GetLowerBound(int dimension)
    GetType        Method        type GetType()
    GetUpperBound  Method        int GetUpperBound(int dimension)
    GetValue       Method        System.Object GetValue(Params int[] indices), System.Object GetValu...
    Initialize     Method        System.Void Initialize()
    Set            Method        System.Void Set(int , System.Object )
    SetValue       Method        System.Void SetValue(System.Object value, int index), System.Void S...
    ToString       Method        string ToString()
    IsFixedSize    Property      System.Boolean IsFixedSize {get;}
    IsReadOnly     Property      System.Boolean IsReadOnly {get;}
    IsSynchronized Property      System.Boolean IsSynchronized {get;}
    Length         Property      System.Int32 Length {get;}
    LongLength     Property      System.Int64 LongLength {get;}
    Rank           Property      System.Int32 Rank {get;}
    

    Arrays in .NET, and PowerShell, are fixed size. To remove an element you need to copy all but the element to be removed, in PSH this can be done with Where-Object:

    $newArray = $oldArray | Where-Object {some-condition-on-$_}
    

    Similarly Select-Object with -First and -Skip parameters can be used to select elements before or after (resp3ectively) an index.


    NB System.Array does implement System.Collections.ILst but the explicit implementation of IList.Remove just throws a NotImplementedException.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have yet another issue which the answer is eluding me. I wish to
Hi coders I have yet another question involving data binding in winforms. I set
i have a directory which contains the following: -directory -another directory -meta.xml -yet another
I have a string which looks like: some token,another token,yet another token,Necessary Token,KNOWN TOKEN,next
I have a web-application in java which is invoked by yet another web-application written
After getting a helpful answer here , I have run into yet another problem:
This is a fairly common problem to which I have yet to find an
I have yet another weird annoying thing going on with Zend. Basically, I have
Okay, I have yet another Code Contracts question. I have a contract on an
I have ran into yet another problem I do not understand. The following does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.