Use tr
:
tr -d '^M' < inputfile
(Note that the ^M
character can be input using Ctrl+VCtrl+M)
EDIT: As suggested by Glenn Jackman, if you’re using bash
, you could also say:
tr -d $'\r' < inputfile
More Related Contents:
- Remove non-ASCII characters from CSV
- Remove multi-line comments
- Insert a line at specific line number with sed or awk
- Remove line if field is duplicate
- delete a column with awk or sed
- How to use awk to print lines where a field matches a specific string?
- What is the difference between sed and awk? [closed]
- Enhancement of unix script [closed]
- shell – remove numbers from a string column [closed]
- sed fails with “unknown option to `s'” error [closed]
- How to select lines between two marker patterns which may occur multiple times with awk/sed
- How can I do a recursive find/replace of a string with awk or sed?
- Bash tool to get nth line from a file
- How to delete duplicate lines in a file without sorting it in Unix
- How can I delete a newline if it is the last character in a file?
- Why doesn’t `\d` work in regular expressions in sed? [duplicate]
- Extraction of data from a simple XML file
- How to add to the end of lines containing a pattern with sed or awk?
- Can I programmatically “burn in” ANSI control codes to a file using unix utils?
- Do a tail -F until matching a pattern
- What are the differences between Perl, Python, AWK and sed? [closed]
- Removing Windows newlines on Linux (sed vs. awk)
- Uppercasing First Letter of Words Using SED
- Add text at the end of each line
- Insert multiple lines into a file after specified pattern using shell script
- Extract lines between two patterns from a file [duplicate]
- sed gives me “: unexpected EOF (pending }’s) error and I have no idea why
- Grep output with multiple Colors?
- using bash (sed/awk) to extract rows AND columns in CSV files?
- How to grep for case insensitive string in a file?