cfGetEveryNthValue ( pList ; pStart ; pIncrement ; pInputSeparator ; pOutputSeparator )
Rate this function: Average rating: 3.5 (2 votes) Discuss this Custom Function
Kevin Frank, Kevin Frank & Associates
http://www.kevinfrank.com
Extract every Nth item from a list; allow starting value and list separators to be specified
Sample Input:
| cfGetEveryNthValue ( "A~B~C~D~E~F" ; 2 ; 3 ; "~" ; "$" ) |
|
Sample Output:
|
Description:
Recently I needed to reduce a list to "every other" item in that list, i.e., the 1st item, the 3rd item, the 5th item, etc.
It occurred to me that in the future I might need, say, every third item rather than every other item, and that I might want to begin with something other than the first item on the list. It also occurred to me that I might want to specify a list separator other than a hard return, for either the input, the output, or both.
That's how this CF came to be.
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
MaxLength ( field, foundCnt ) |
| |
(Thu, Jul 29, 4:37pm) |
| 2. |
DayCounter ( Date_Start ; Date_End; Days_of_Week ) |
| |
(Wed, Jul 28, 1:20pm) |
| 3. |
Is_FM_Go_iPad |
| |
(Fri, Jul 23, 7:55am) |
| 4. |
Is_FM_Go |
| |
(Fri, Jul 23, 7:54am) |
| 5. |
IsFilled ( field ) |
| |
(Wed, Jul 21, 7:19am) |
| 6. |
DateQuarterAsRange ( theDate ) |
| |
(Thu, Jul 15, 5:37pm) |
| 7. |
DateQuarterEnd ( theDate ) |
| |
(Thu, Jul 15, 5:35pm) |
| 8. |
DateQuarterBegin ( theDate ) |
| |
(Thu, Jul 15, 5:30pm) |
 |
|