I used
sed 's/\r\n$//' inputFile
however it didn't work. I don't know why
I also tried
awk '{ printf "%s", $0 }' inputFile
but it deletes only \n but not \r
How should I do to remove the specific combination of CRLF(\r\n) at the end of a line in linux?
P.S.
I think this is not duplicate of this given the specific condition of my question. I want the CRLF(\r\n) at the end of a line to be removed. tr
won't work because tr
the appearance to be removed would not necessarily at the end of the line, and the admin require not to install dos2unix
. In my case sed 's/\r\n$//' inputFile
is not working and I pretty much tried all the possible solution in this.
By the way, with tr
, the appearance to be removed would not necessarily at the end of the line, and \r\n
in tr
is a set of \r
and \n
. In other words, it would delete \r
in \r
is in the middle of the line.
Clarification:
I have one line input. I want the \r\n
to be totally removed.