Contraction of series of numbers

I'm sure I've seen this script somewhere in the forums, but I haven't managed to find it regardless of the search terms I use.
Basically I'm trying to contract a series of numbers into a span of numbers.
For example:
     41, 42, 43, 44, 45
will become:
     41-45
After that I will write a script to further reduce that to '41-5' as suitable for indexes.
Of course, this is more of a pure javascript problem than a pure InDesign problem since we are just dealing with a string, then converting to an array of numbers, then contraction. But I'm sure I found it here... anyway.
Any help with finding this script/thread is much appreciated.

Thank you for your prompt attention to my problem. The result should be an array of strings, rather than a number. As such, this is far from solved.
Anyone able to address the original problem of contracting spans of numbers?
I'm sure we've dealt with this before. My search terms are wanton.
In more detail: when finished with index generation in InDesign we often end up with a series of sequential numbers. The pure way to deal with this is to modify the index entires to deal with the relevant spans (via styles, page count, etc), but without the time (or client budget) I'm looking for a way to reduce a series of numbers into an array of number spans.
(Yes, I realise we are converting strings to numbers and then re-combining as strings, but I'm sure we've dealt with this before. Brain's trust, haven't we done this before?)

Similar Messages

  • How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid

    How do I go about getting the product serial number to register my product as well as install my product.  I bought it with a product box.  On the software disc sleeve, there is a series of numbers pasted at the bottom of the sleeves but this is not valid.  When I tried to type this in for registration, it does register as this numbers also contain letters in it.  Apparently the registration boxes accept numbers only.  What do I do with a useless product for which I have paid good money for it?????

    This is the simple solution which was offered to me when I tried to get the serial code on line.
    The box and disc sleeve do not contain a series with 24 numbers which I presume is the product code to install.
    I tried to redeem the registration code by following what they recommended, but inevitably it gets to the page that showed the registration boxes that need 24 serial numbers and I got stuck again.
    This product is so different what my previous experiences of other software products where I just enter the serial number straight from the disc sleeve and then I got registered and go on to use the software.
    I is really frustrating, spending the last two hours trying to get my product going....

  • How to create a monthly series in numbers

    I'm trying to create a monthly date series in numbers for iphone app. When I try to fill down A1:A2, it is presented as B1:B5. I want the column to show the  first day of each month. I can't find a function that accomplishes this.
    Header 1
    Header 2
    6/1/13
    6/1/13
    7/1/13
    7/1/13
    7/31/13
    8/30/13
    9/29/13

    Hi DC,
    You've asked in the community discussing Numbers for Mac OS X, so this response may not be applicable to Numbers for iOS. If not, you migth try reposting your question in the iWork for iOS community.
    Here are two methods using formulas to ceate the date series you want:
    Column B: Seed date is entered in B2.
    Formula is entered in B3 and filled down to end of column.
    B3: =EOMONTH(B2,0)+1
    Column C: Formula entered in C2 and filled down.
    C2: =DATE(2013,ROW()-1,1)
    Note the warning triangles in the last three rows. These warn that the formula is receiving a number greater than 12 for the month argument to the DATE formula. It is a warning of an unusual situation, but not a red error alert as the formula continues to produce the cirrect result.
    Italics formatting was applied manually to draw attention to these three cells. The blue triangle may be dismissed with two clicks, one to show the warning:
    the other to tell Numbers to ignore the cause. This must be repeated for each cell showing this error.
    Regards,
    Barry

  • IN NUMBERS HOW DO YOU FILL IN FOR A SERIES OF NUMBERS OR DATES

    In numbers how do you fill in for a series of numbers or dates without doing it manually

    You can enter a value in two cells that establishes a pattern, then select the two cells, then click (and hold) on the little circle at the bottom right corner of the selection and drag to fill as needed.
    A Number sequence:
    A Date sequence:

  • As of Contract Management 13, serial numbers are no longer used.

    Hello Primavera users,
    We are currently using Contract Manager v12 on a major program here in the UAE and looking to upgrade soon to v13.
    Regarding this knowledge base posting (below), does v13 still support concurrent user licenses, and if so what are Oracle's plans moving forward in terms of Contract Manager?
    I would love to hear the views of the Primavera community, especially in relation to these changes with serial numbers etc...
    Thanks & Regards,
    John
    Solution ID: prim83632
    How To: Adding (new) serial numbers in Contract Management 13
    Status: Reviewed
    Version(s): 13.0
    Problem:     How To: Adding (new) serial numbers in Contract Management 13
    Problem:     Where do I add new serial numbers in Contract Management 13?
    Problem:     Where are serial numbers stored?
    Fix:     As of Contract Management 13, serial numbers are no longer used.

    Well, it's just a simple pipe afterall, a tool to give you brief information upon which you decide what to do. Also, there's a minor annoyance, it should go like this:
    stat -c '%x %n' /usr/bin/* | sort
    I mixed long and short options for a moment there, that gets rid of the '=' in front of every line.

  • I am trying to copy and paste a series of numbers from numbers to pages but I keep getting a red triangle indicating formula error. Is there a way a way to open pasting options to copy just the value to avoid writing every single number??! Thanks..

    I am trying to copy and paste a series of numbers that were calculated in a numbers spreadsheet to a document on pages but I keep getting a red triangle indicating a formula error. Is there a way to open pasting options to copy just the value to avoid writing every single number??! Thanks..

    Hi Jess'D,
    Have you tried Menu>Edit>Paste Formula Results?
    quinn

  • Lack of series/episode numbering on guide?

    Can anyone explain why there is not any episode/series numbering on the program listing? I find this very frustrating when there are multiple copies of a program recorded or when I want to record a program.
    Regards
    corpx

    guilbo wrote:
    ikolpdog wrote:
    Masona is right:
    TVGuide
    Recordings
    Scheduled Recordings
    Select your chosen Program
    Series Info
    Change Settings
    Show Type -  Change to First run only
    Save
    Pain in the Arris but it does work.
    HA HA HA. You just tell the best jokes. Try that with just about anything on BBC3 or ITV2 and see how far you get.
    Why Guilbo, I didn't think you were capable.
    Of having a go at another user.
    You have been so helpful in so many circumstances, to so many users, I'm shocked.
    I do it all the time, to trolls, but hey, thats me. But I've never seen you do it, to anyone. On this, or any other forum.
    It's a surprise to say the least.
    Are you OK?
    I guess there's a first for everything...
    Rank - Mostly Harmless.

  • Contract Generation question: Formatting, Numbering of clauses, variables

    Hi!
    I am trying to create a Contract Document Template (for Contract Generation) with Variables
    I created some Variable Collections, but when I link them to the Contract Template, they add on with a different formatting altogether, which is neither like the placeholder in the template nor like the template attached to the variable.
    My variable configuration was of the type Paragraph.
    If anyone has any helpful tips on formatting Contract Document Templates, it would be most appreciated.
    Also, how do I ensure that numbering of sections and clauses is sequentially made in the final Contract.
    Regards,
    Reshma

    I was able to fix the problem by making some word document format changes.
    Please ignore this question.
    Regards,
    Reshma

  • Powerbook G3 Series production numbers

    I am trying to guess how many Wallstreets, Lombards, Pismos were made. I found numbers in old Apple annual reports but they use a fiscal year reporting that does not sync with product launch dates so it is hard to calculate this way. I also heard the Lombard 400 is the lowest production of them all. Another site from way back said only several hundred thousand each. Does anyone have any sources for this information?

    You could go here
    http://www.geocities.com/Athens/3682/applehistory.html
    and scroll down to the bottom and contact some of the people there.
    I am sure someone would be able to give you the info or at least point you in the right direction.
    Stewie

  • TS1292 Hello, I accidentally scratched off a series of numbers on an itunes giftcard is there any way I can still redeem this card?

    Is there a way to redeem an itunes giftcard ( if some of the numbers were accidentally scratched off?)

    Have you been through this page : http://support.apple.com/kb/TS1292 ? There is also a link for iTunes support at the bottom of that page

  • Animating a series of numbered stills

    i have a really long sequence of numbered stills, each one a frame, and i cant seem to get imovie to import them to create a video, it only want to do it as each individual picture for a slide show, and makes each picture last for 5 second while i only want it to last 1 frame. any body have any ideas?

    * import ONE picture into iM
    * in the Ken Burns settings, switch OFF KB effect
    * set length to 1 frame, 00:00:01
    * now, drag'n drop the rest of your pics into project ...
    or, if you own QTpro, open folder of pics as "picture sequence" and export as dv-stream for further processing in iM ...

  • I've got a file that is getting auto-created on my desktop, that is a .textClipping file with a very long series of numbers and letters as the filename (and of course, as the clipping as well).  Is there any way to tell what is creating this file?

    As the title states, I've got a .textClipping file that keeps getting created on my desktop when I log in.  The file looks similar to: "6bc29bf81b634b3293da5e858930e06a88adf182.textClipping".  I'm trying to figure out what is creating this file.  Any suggestions?
    Thanks in advance.

    Login items:
    SophosUIServer
    textexpanderd (Text Expander 2.x - possibly the culprit?)
    TotalFinder
    Remote Wonder Driver
    Lockdown
    macfusionAgent
    Most of these I've had installed for a year or more.  TotalFinder and Text Expander may be relatively new.

  • How Generating Series Of Numbers Without  use Sequences

    i wana use insert table
    i use
    insert table_name (id)
    vaule (( SELECT ROWNUM N FROM dual CONNECT BY LEVEL <= 20))
    but error ORA-01427: single-row subquery returns more than one row

    ali_alkomi wrote:
    ORA-01427: single-row subquery returns more than one row
    insert into FISH_FAMILIES(SCIENCE_NAME,ARABIC_NAME,LATIN_NAME,IS_FAMILY)
    values ( (select distinct FAMILY from FISH_SPECIES) ,(select ARABIC_DESCRIPTION from FISH_SPECIES) ,(select LATIN_DESCRIPTION from FISH_SPECIES),(select distinct IS_FAMILY from FISH_SPECIES
    ))STOP POSTING YOUR SAME QUESTION ON DIFFERENT THREADS!
    how use insert more than query (select)
    If you continue posting the same on both threads, I will lock or delete one of them.

  • Help summarizing a series of numbers

    Hello,
    The following SQL gives the output as
    450039 - 450090
    450041 - 450041
    WITH wsh_Serial_numbers as
    ( select
    72016 delivery_detail_id , 450039 fm_serial_number, 450039 to_serial_number from dual
    union all
    select 72016 ,450040, 450040 from dual union all
    select 72016, 450041, 450041 from dual union all
    select 72016, 450089 ,450089 from dual union all
    select 72016 ,450090 ,450090 from dual )
    SELECT from_num||' - '||to_num Serial_Numbers
    FROM
    WITH all_data1 AS
    SELECT delivery_detail_id detail_id,
    fm_serial_number f_serial_no ,
    to_serial_number t_serial_no ,
    NVL(lead(fm_serial_number) over (partition BY delivery_detail_id order by fm_serial_number)-fm_serial_number,1) lead
    --NVL(fm_serial_number-lead(fm_serial_number) over (partition BY delivery_detail_id order by fm_serial_number),1) lead
    FROM wsh_Serial_numbers all_data1
    WHERE delivery_detail_id = 72016--p_delivery_detail_id
    ORDER BY delivery_detail_id
    SELECT detail_id ,
    MIN(f_serial_no) FROM_num,
    MAX(f_serial_no) TO_NUM
    FROM all_data1
    GROUP BY detail_id, lead
    ORDER BY MIN(f_serial_no)
    But the desired result is
    450039 - 450041
    450089 - 450090
    Could some one suggest how do I get this result?
    Regards,
    Srini

    Hi,
    Solution with model caluse( 10g).
    Regards salim.
    select delivery_detail_id , min(fm_serial_number)||'-'|| max(to_serial_number)  res
    from (
            select delivery_detail_id ,  fm_serial_number,  to_serial_number,grp
            from wsh_Serial_numbers
            model
            partition by (delivery_detail_id)
            dimension by( row_number()over(partition by delivery_detail_id order by fm_serial_number) rn)
            measures(fm_serial_number,  to_serial_number, 0 grp)ignore nav
            ( grp[any]= case when nvl(fm_serial_number[cv()]-to_serial_number[cv()-1],1)=1  then
            grp[cv()-1] else grp[cv()-1]+1 end )
    group by delivery_detail_id ,grp
    WITH wsh_Serial_numbers as
    ( select 72016 delivery_detail_id , 450039 fm_serial_number, 450039 to_serial_number from dual union all
    select 72016 ,450040, 450040 from dual union all
    select 72016, 450041, 450041 from dual union all
    select 72016, 450089 ,450089 from dual union all
    select 72016 ,450090 ,450090 from dual )
    select delivery_detail_id , min(fm_serial_number)||'-'|| max(to_serial_number)  res
    from (
            select delivery_detail_id ,  fm_serial_number,  to_serial_number,grp
            from wsh_Serial_numbers
            model
            partition by (delivery_detail_id)
            dimension by( row_number()over(partition by delivery_detail_id order by fm_serial_number) rn)
            measures(fm_serial_number,  to_serial_number, 0 grp)ignore nav
            ( grp[any]= case when nvl(fm_serial_number[cv()]-to_serial_number[cv()-1],1)=1  then
            grp[cv()-1] else grp[cv()-1]+1 end )
    group by delivery_detail_id ,grp
    DELIVERY_DETAIL_ID RES                                                                             
                 72016 450039-450041                                                                   
                 72016 450089-450090                                                                   
    2 rows selected.

  • Suddenly getting a long series of numbers and alphabet that take up a page..under recved, DKIM-Signatures, ete. How do I turn that off?

    X-originating-IP, long line of categories and alpha&numerical + word commentaries that I usually don't see and do not want to see.
    How do I turn that off to 'normal' info display?

    Thank you so much...simple when 'one' knows where to look :)::

Maybe you are looking for

  • Sales order : Creation of VBAP main lines from VBEP schedule lines

    Hello , I am working on SAP sales order interfacing with legacy system. This is the scenario where legacy system orders will come to SAP system for availability check. I mean , the legacy system sales order are replicalted in SAP system. and the avai

  • Use DSAdd Group for adding several groups at the same time

    Good Afternoon!, As is written in my book: "By leaving the DN parameter empty, at which point you can type the DNs one at a time at the keyboard console of the command prompt. Press Enter after each DN. After the last DN, press Ctrl+Z, and then press

  • JMF How to stream rtp from udp packet

    I implemented an rtsp client and use the client to setup two rtp session(audio, vedio). But when I use the example pramgram "AVReceive3" to stream the udp packet, it doesn't work. When the AVReceive3 receive the udp packet from the rtp port, it will

  • Sort array in TestStand

    Hi, I have an array of custom type container, something like: - TestName - Type - Operation I'd like to sort this array by Type and Operation. Is that possible in TS 2010? If not - what is the best way to do that? I'm using also LabVIEW and C/C++. Th

  • MEPO151 - ME_PROCESS_PO_CUST / IF_FLUSH_TRANSPORT_MM~START

    Dear All, I'm using ME_PROCESS_PO_CUST (PROCESS_ITEM) to make some modifications. Everything is working ok but when I want to create a PO with reference to another PO, after I press Adopt button - the system issues this message. As I read in the info