this thread features an export script that deletes a trailing comma.
So perhaps a double somersault where you first insert a unique character after each track, then remove the trailing one and finally replace the unique characters with carriage return and line feed characters.