I was using sqlcmd to export some tables to text files. The problem was at the bottom of every file there was a blank line and something like (83 rows affected).
I was going to just live with this. But then had an aha moment. I should have been using the BCP utility, not sqlcmd.
Here is how to export a table in BCP with the pipe delimiter, with a trusted connection:
bcp DBName.dbo.TableName out D:\FileName.txt -T -c -t”|”