Hello,
This is my first time using this forum so please be gentle. Your time and help would be greatly appreciated.
I've built a list of all zip codes in the US with their corresponding organization code, of which there are ~100. A total of ~42k rows.
I now need to group the data in a format consisting of a range of zip codes in each org, with a starting zip code and ending zip code. These ranges need to skip any zip codes not listed. So if a New York org went; 12540, 12541, 12542, 12543... on to 12553 then skipped to 12555, then to 12563 and carried on 12564, 15565... to 12572 the ranges would be 12540-12553, 12555 - 12555, 12563 - 12572. Below is an example of my data set and the format I need it in.
What I have:
<colgroup><col><col><col></colgroup><tbody>
</tbody>
What I need:
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
I've been spinning my wheels on this for over a week. This is my last ditch effort before pushing back and admitting I can't do this.
This is my first time using this forum so please be gentle. Your time and help would be greatly appreciated.
I've built a list of all zip codes in the US with their corresponding organization code, of which there are ~100. A total of ~42k rows.
I now need to group the data in a format consisting of a range of zip codes in each org, with a starting zip code and ending zip code. These ranges need to skip any zip codes not listed. So if a New York org went; 12540, 12541, 12542, 12543... on to 12553 then skipped to 12555, then to 12563 and carried on 12564, 15565... to 12572 the ranges would be 12540-12553, 12555 - 12555, 12563 - 12572. Below is an example of my data set and the format I need it in.
What I have:
Zip Code | State | Org |
12541 | New York | 3905 |
12542 | New York | 3905 |
12543 | New York | 3905 |
12544 | New York | 3905 |
12545 | New York | 3905 |
12546 | New York | 3905 |
12547 | New York | 3905 |
12548 | New York | 3905 |
12549 | New York | 3905 |
12550 | New York | 3905 |
12551 | New York | 3905 |
12552 | New York | 3905 |
12553 | New York | 3905 |
12555 | New York | 3905 |
12561 | New York | 3905 |
12563 | New York | 3905 |
12564 | New York | 3905 |
12565 | New York | 3905 |
12566 | New York | 3905 |
12567 | New York | 3905 |
12568 | New York | 3905 |
12569 | New York | 3905 |
12570 | New York | 3905 |
12571 | New York | 3905 |
12572 | New York | 3905 |
12574 | New York | 3905 |
12575 | New York | 3905 |
12577 | New York | 3905 |
12578 | New York | 3905 |
12580 | New York | 3905 |
12581 | New York | 3905 |
501 | New York | 3901 |
544 | New York | 3901 |
10001 | New York | 3901 |
10002 | New York | 3901 |
10003 | New York | 3901 |
10004 | New York | 3901 |
10005 | New York | 3901 |
10006 | New York | 3901 |
10007 | New York | 3901 |
10008 | New York | 3901 |
10009 | New York | 3901 |
10010 | New York | 3901 |
10011 | New York | 3901 |
10012 | New York | 3901 |
10013 | New York | 3901 |
10014 | New York | 3901 |
10016 | New York | 3901 |
10017 | New York | 3901 |
10018 | New York | 3901 |
<colgroup><col><col><col></colgroup><tbody>
</tbody>
What I need:
STATE | FROM_POSTAL_CODE | TO_POSTAL_CODE | ORG_CODE |
New York | 12540 | 12553 | 3905 |
New York | 12555 | 12555 | 3905 |
New York | 12561 | 12561 | 3905 |
New York | 12563 | 12572 | 3905 |
New York | 12574 | 12575 | 3905 |
New York | 12577 | 12578 | 3905 |
New York | 501 | 501 | 3901 |
New York | 544 | 544 | 3901 |
New York | 10001 | 10048 | 3901 |
New York | 10055 | 10055 | 3901 |
New York | 10060 | 10060 | 3901 |
New York | 10065 | 10065 | 3901 |
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
I've been spinning my wheels on this for over a week. This is my last ditch effort before pushing back and admitting I can't do this.