-1

This seems to be enough of a common occurrence that people need, but in the answers I have found so far, they are in another programming language, do not achieve the full effect that is ready to use, or act in reverse:

One recommendation was to use Lazy.js, but there is no special function there. I could certainly compose some statements and work through the problem, just like a couple of others have done as well.

I was expecting a ready-made interface that accepts a string, and outputs the expanded list of single integers (as I think that would be easiest for the program to operate on, not sure). Something like "1,3-6,7,12-13", or even "1,3-6,7,12-13, 17-" with 26 pages would produce "1,3,4,5,6,7,12,13,17,18,19,20,21,22,23,24,25,26" (1-indexed, all inclusive). That's all of the possibilities I can think of for syntax and capability this far.

Are there any code files, functions, or libraries that are already made and available, implying greater and some testing, that are available in a Linux Shell/CLI tool (similar to seq), JavaScript, or even Python package format, that I can use out-of-the-box (OOB?) / immediately without additional creative effort required to build this functionality.

Pysis
  • 1,452
  • 2
  • 17
  • 31
  • Is someone following me and downvoting? Is there an automatic system doing this? Otherwise, what is wrong with the question? – Pysis Jul 20 '17 at 18:56
  • I have not down-voted you but a reason for doing so is [Off-topic reason #4](https://stackoverflow.com/help/on-topic). – Mike Kinghan Jul 20 '17 at 19:25
  • I didn't know how to get around asking what has been made that could be brought to my attention, from a site with a lot of users that could have seen more than I have, after my Google searches that I have posted, in any other place or form. Similar questions to mine have upvotes as well. – Pysis Jul 20 '17 at 19:28

1 Answers1

0

After looking a bit farther, I had to specifically go to the NPM website rather than Google, I found a couple of projects that seem to be what I want, and have a high number of downloads:

Although, they do not support the syntax I was hoping for, that is common in several products' UIs, and deal with interpolated strings, whereas I want that to be the only type of input.

Other, less popular ones I have found, are:

Almost, yet still, un-related:

If only this worked in reverse, and parsed strings:

My next issue would be to get these easily accessible from the CLI, as I like to do a lot of my work and data-chaining from there.

I am still curious if there are any Linux CLI packages made to help me with this.

Pysis
  • 1,452
  • 2
  • 17
  • 31