i guess this problem (a space at the end of the file) is because delemit_str is a space.

Have you already tried to set the delemit_str to "" before you write the last var into you file? Then you wont get a space at the end, maybe. (Ive never tested )


nipx