Multiple Records from 1 Record

I need to make one record to multiple records based on occurence column in the record and change the date.For example below first record has 5 ,so need to create 5 records from one and change the date to 5 months.Occurence can be any number.

I am unable to come with a script.Can some one help

Below is the input file

Id Name Date Occurence,Sal
1,ABC,Jan07,5,100
2,DEF,Dec06,14,600

Output File i Need is

Id,Name,Date,Occurence,Sal

1,ABC,Jan07,5,100/5
1,ABC,Feb07,5,100/5
1,ABC,Mar07,5,100/5
1,ABC,Apr07,5,100/5
1,ABC,May07,5,100/5
2,DEF,Dec06,14,600/14
2,DEF,Jan07,14,600/14
2,DEF,Feb07,14,600/14
2,DEF,Mar07,14,600/14
2,DEF,Apr07,14,600/14
2,DEF,May07,14,600/14
2,DEF,Jun07,14,600/14
2,DEF,Jul07,14,600/14
2,DEF,Aug07,14,600/14
2,DEF,sep07,14,600/14
2,DEF,Oct07,14,600/14
2,DEF,Nov07,14,600/14
2,DEF,Dec07,14,600/14
2,DEF,Jan08,14,600/14

try this..

awk -F, '{if(NR!=1){ P=$4;for(i=1;i<=P;i++){ print $0"/"P}}else{print}}' file

Like this?

awk -F, '{$0=$0"/"$4;for(i=1;i<=$4;i++) print}' file

I hope the headers are just to differentiate the fields and do not actually occur in the input.

Thanks ,This is creating Multiple records,But i would need the date also to be changed.Date should increment by 1 month for every record

awk -F, 'BEGIN{split("Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",mname,",")
for(i=1;i<=12;i++) mnum[mname]=i}
{mon=mnum[substr($3,1,3)];yr=substr($3,4,2);
$0=$0"/"$4;for(i=1;i<=$4;i++){
 $3=mname[mon++] sprintf("%02d",yr)
 if(mon==13) {yr++;mon=1}
 print
}}' OFS=, file
1 Like

Thanks a lot ..Very helpful