Thanks zaxxon.
A slight change,
My file is of below format:
abc,111,222,333,jjj,22
xyz,398,399,834,ww,33
jdj,398,947,487,eee,44
abc,535,33,34,jjj,22
sss,43,3,53,dd,ter,33
ks,343,3,4,jsj,33
d,94,94999,re,ere
cc,33,53453,xd,22
abx,343,33,jjj,55
As we can see in 5th column, "jjj", the number of rows between two jjj shoud be 7.
the o/p should be as :
abc,111,222,333,jjj,22
xyz,398,399,834,ww,33
jdj,398,947,487,eee,44
NULL,0,0,0,0,0
NULL,0,0,0,0,0
NULL,0,0,0,0,0
NULL,0,0,0,0,0
abc,535,33,34,jjj,22
sss,43,3,53,dd,ter,33
ks,343,3,4,jsj,33
d,94,94999,re,ere
cc,33,53453,xd,22
NULL,0,0,0,0,0
NULL,0,0,0,0,0
abx,343,33,jjj,55
could anyone help me ?