You should try removing the format-table from your pipeline. It isn't required when exporting to csv, and is only for displaying objects on screen.

You can rename properties in your select statement. If Extensionattribute6 is to be renamed to attrib6 you replace the property name in the select-object properties list with a hash table like @{"name"="attrib6";"expression"={$_.Extensionattribute6}}

Plus with Export-CSV is looking for objects from the pipeline. Adding the Format-Table in there I think will give you one line for each data item, but it will be some data from Format-Table, it won't be your actual data. Not sure I exactly understand it, but I know by past error this is not the result I want. Learned by trial and error. Good luck.