Thanks Lonkero, that has worked brilliantly :-)

I understand that the script now checks if it is at position 4 ($r=3) so I'll make sure I take this into account when setting $aAttributes, but can you tell me why the script needs to add a line feed? is this because the description field is being seen as a list of things rather than a plain text field?

Thanks again for your help.

Pete.