How to give a range with values?

P

pemt

Dear all,

I have a series of data only with range and each item has several ranges. I
want to give "1" as values to all spots within all ranges and the rest as
"0". Each item has 100 spots from 1-100.
For example,
Name Range1 Range2 Range3
ITEM1 10-20 30-55 60-80
ITEM2 35-45 72-88
ITEM3 8-15
.....
for ITEM1: 1-9, 21-29, 56-59 and 80-100 will be "0", the rest will be "1".
ITEM2: 1-34, 46-71, 89-100 will be "0", and the rest will be "1",
ITEM3: 1-7 and 16-100 will be "0", and the rest will be "1".

How to do it? Thanks a lot!

pemt
 
K

KARL DEWEY

I do not follow. Where will the '1' or '0' be placed or displayed?

How is your data stored? Table and field names with datatypes?

Post sample data and how you expect the results to look.
 
P

pemt

Sorry Karl,

I didn't describe it clearly. Actually, there are two files. Both are range
files.
RangeFile1:
ITEM RangeStart1 RangeEnd1
ITEM1 1 100
ITEM2 20 200
ITEM3 2 12

RangeFile2:
ITEM RangeStart2 RangeEnd2
ITEM1 10 20
ITEM1 50 66
ITEM1 88 92
ITEM2 10 30
ITEM3 4 8
ITEM3 10 18

Results:
Range 1 2 3 4 5 6 7 8 9 10 11 12 ...20 21... 50 51...66 67...87 88...91 92
93....100
ITEM1 0 0 0 0 0 0 0 0 0 1 1 1 ... 1 0 ... 1 1... 1 0 ... 0
1... 1 1 0 .... 0

Range 20 21 22 ... 29 30 31 32 ... 200
ITEM2 1 1 1 ... 1 1 0 0 ... 0

Range 2 3 4 5 6 7 8 9 10 11 12
ITEM3 0 0 1 1 1 1 1 0 1 1 1

As you can see, every number from each item range in RangeFile1 will be
given a number of "1" or "0" based on RangeFile2.

Wish your great help again.
Thanks,

pemt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top