Jump to content

Recommended Posts

Posted

I have an array with 40 numbers.

I want to have the top 20 numbers and delete the rest.

I looked at _ArrayDelete example:

; Range string
$aArray = $aArray_Base
Local $sRange = "0;11-15;24"
_ArrayDisplay($aArray, "BEFORE deletion")
_ArrayDelete($aArray, $sRange)
ConsoleWrite(" " & @error & @CRLF)
_ArrayDisplay($aArray, "RANGE STRING deleted")

Så I was thinking I could do this:

_ArrayDelete($aArray, '0;19')

But that does not give me want I want.

How can I keep my top 20 numbers and delete the rest?

Yours sincerely

Kenneth.

Posted

the range is defined by hyphen, not semicolon. use "0-19" to remove lines 0 to 19, not "0;19".

BTW you are not clear if you want to keep the first 20 or the last 20 rows.

Signature - my forum contributions:

Spoiler

UDF:

LFN - support for long file names (over 260 characters)

InputImpose - impose valid characters in an input control

TimeConvert - convert UTC to/from local time and/or reformat the string representation

AMF - accept multiple files from Windows Explorer context menu

DateDuration -  literal description of the difference between given dates

Apps:

Touch - set the "modified" timestamp of a file to current time

Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

SPDiff - Single-Pane Text Diff

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...