Brian Dunning's FileMaker Custom Functions

pagenumbers_condensed_with_dashes ( input ; flag_series )

Condensing comma-separated lists of page-numbers with dashes

  Average rating: 4.2 (34 votes) Log in to vote

Jens Teich   Jens Teich - Show more from this author
DJTO
http://jensteich.de

Share on Facebook Share on Twitter

  Sample input:
pagenumbers_condensed_with_dashes("15, 16, 18, 19, 20, 21, 25" ; 0)
  Sample output:
15-16, 18-21, 25

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

The second parameter is only required for internal purposes and is always zero when calling the function.

 

Comments

Ian Renwick   Ian Renwick, Melbourne Australia
Jan 14, 2015
I had almost 3000 products many with multiple page references. I needed to make an index for a catalog. This worked perfectly for my requirements, e.g

202, 203, 204, 205, 206, 207, 208, 209, 210, 211 became 202-211

162, 163, 164, 165, 364, 365 became 162-165, 364-365

Brilliant!
 
Denham Morgan   Denham Morgan, Knoxville TN, USA
Jul 8, 2015
Nevermind I figured it out.
 
Andrea Astolfi   Andrea Astolfi, Italy
Apr 30, 2018
This function is fantastic. It works fine
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: