Try this Powershell script:
$fileName = "file.txt"
$content = Get-Content -Path $fileName -Raw -Encoding UTF8
$newcontent = $content.Replace("`r","").Replace("`n","")
Write-Host "Content: $newcontent"
$newfilename = "newfile.txt"
Out-File -FilePath "$newfilename" -force -InputObject $newcontent