remove Blank Lines at End of a Text File Tagged: File read/write This topic contains 4 replies, has 3 voices, and was last updated by Nithun Damodaran 2 years, 2 months ago. Author Posts September 23, 2014 at 9:46 pm #19050 Nithun DamodaranParticipant Am trying to copy contents from a text file to another file and it crates an empty line at the end of the file every time. Using PS v 3 and tried most of the available methods/one liners in the web, Any thoughts ? # Enable Dashboard $EnData = gc C:\DB\urls_EnableMon.tsv sc C:\DB\urls.tsv $EnData September 23, 2014 at 9:57 pm #19051 Don JonesKeymaster So... why not just use Copy-Item? September 23, 2014 at 10:17 pm #19053 Nithun DamodaranParticipant My Bad!! That thought didn't strike me 🙁 Was busy breaking my head with copying contents in the file. Thanks you so much Don , You are truly inspiring !! September 24, 2014 at 2:09 am #19056 Gilbert van GriensvenParticipant I've recently stumbled upon the extra linefeed in textfiles created with powershell and found a nice solution for that on Stack Overflow September 24, 2014 at 3:12 am #19057 Nithun DamodaranParticipant @Gilbert I have tried that and somehow it didnt work Author Posts You must be logged in to reply to this topic.