in reply to Re^3: to csv file
in thread to csv file

I really must read more carefully in the morning! :-P
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)