Javier Ruere wrote: > for i in range(alvl, clvl): > csvline = csvline + '"' + pl[i] + '",' > > should be replaced by something like the following: > > cvsline += '"' + pl[alvl:clvl].join('",') or maybe more like this: cvsline += '"' + '",'.join(pl[alvl:clvl]) + '",' though if alvl == clvl this will output an empty cell. Kent