Hi Mark,

Thank you Mark, I really appreciate all of your help. My son is indepently working on a solution,
and he was asking if you would be so kind as to take a look at his script for him?. He had this 
working at one point, but then something happened and now his script is broken. He's trying to 
run his script and have a couple of stats returned at the bottom of the sample results. He never 
reached the point where he can pass nonconsecutive values, but he did get the script at one point 
to do the following:

[root@usreliance Biorad]# ./sample15.sh -s 0-9 -c 2-3
                Ch2     Ch3
Sample 0:       0x4a03  0x5703
Sample 1:       0x1e03  0x0904
Sample 2:       0x4003  0xae03
Sample 3:       0x3303  0xad03
Sample 4:       0x4303  0x6203
Sample 5:       0x3403  0xc403
Sample 6:       0x5303  0x6103
Sample 7:       0x4203  0x5803
Sample 8:       0x5703  0x6203
Sample 9:       0x3103  0x3303
Total samples in samples.bin: 374371
Total samples iterated: 10

Here is his script sample15.sh in it's current state:

#!/usr/bin/env bash
samps=""
chans=""
total=""

while getopts cstr opt; do
    case $opt in
        s) samps="$OPTARG" ;;
        c) chans="$OPTARG" ;;
        t) total=$(hexdump -v -e '8/1 "%02x " "\n"' samples.bin | wc -l) ;;
        r) {
             printf "Total Samples in Record:\t"$(hexdump -v -e '8/1 "%02x " "\n"' samples.bin | wc -l)"\n"
             exit
           } ;;
        *) printf 'Unrecognized option "%s"\n' "$opt" >&2
    esac
done
shift $(( OPTIND - 1 ))

hexdump -v -e '8/1 "%02x " "\n"' samples.bin |
awk -v samps="$samps" -v chans="$chans" -v totalIterated="$total" '
  BEGIN {
    if (totalIterated != "") {
      totalRecords = totalIterated
      totalIterated = 0
    }

    # split sample string to arrays using "-" as delimiter
    split(samps, srange, "-")
    # split channel string
    split(chans, crange, "-")

    # arbitrary INT_MAX
    samples_max=(totalIterated != ""?totalRecords:2^52)
    # default 4 channels as per prerequisite example
    chan_default=4

    # set default samples
    if (!srange[1]) srange[1] = 0
    if (!srange[2]) srange[2] = samples_max
    # set default channels
    if (!crange[1]) crange[1] = 0
    if (!crange[2]) crange[2] = crange[1] + chan_default-1

    # print channel header row
    printf "\t\t"
    for (i=crange[1]; i<=crange[2]; i++) {
      printf("Ch%d%s", i, (i==crange[2]?"\n":"\t"))
    }
  }
  {
    if(NR >= srange[1] + 1 && NR <= srange[2] + 1) {
      if (totalIterated != "") ++totalIterated
      start=(crange[1] + 1) * 2 - 1
      end=(crange[2] + 1 ) * 2

      # print sample range
      printf("Sample %d:\t", NR-1)

      # print channel range in sample line
      for (i = start; i <= end; i+=2) {
          j = i + 1
          printf("0x%s%s%s", $i, $j, (i==end||j==end?"\n":"\t"))
      }
    }
  }
  END {
    if (totalIterated != "")
      printf("Total Samples in Record:\t%d\nTotal Samples Processed:\t%d\n", totalRecords, totalIterated)
  }
'