I'm using the following fake dataset for the current problem:


Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(HarvestStartDateWeek PrePlantArea4 PrePlantArea11 PrePlantArea24 PrePlantArea30 i)
1 8601.442 11763.557 15198.318  7750.83 1
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
1        0         0         0        0 0
2 8601.442 10762.294 15198.318 6874.988 2
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
2        0         0         0        0 0
3 8601.442 11832.802 14779.105 7879.584 3
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
3        0         0         0        0 0
4 8601.442 11588.824 14446.906  8310.56 4
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
4        0         0         0        0 0
5 8601.442 11549.822  15768.53 7879.584 5
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
5        0         0         0        0 0
end
The goal is to reshape in the following way:

Code:
reshape wide PrePlantArea* , i(HarvestStartDateWeek) j(i)
However, I first need to replace i. To get the reshape I desire, I need to replace i such that it contains the sequence 1-20 (1,2,...,20) for each week (HarvestStartDateWeek). What makes this difficult for me is that I want to fill in the sequence 1-20 but skip the value already present for i by HarvestStartDateWeek. For example, i = 1 for the first week and so the sequence needs to be filled forward to 20. For week 2, i = 2 and I want the sequence 1-20 skipping 2, which is already present for i in week 2. So for week 2, I want to fill the sequence forwards from 2 to 20 and backwards from 2 to 1.

I'm hoping this makes some sense. Any suggestions are much appreciated.