You can easily remove them using "tr" cmd.
The above command should write the new file to stdout. Save it to a new file, and this will not have "\r" characters.
What problems may happen
The "\r" character is generally interpreted by terminals to move the cursor to the beggining of the current line. The "\n" character moves the cursor to the next line. Generally, a text file created in Windows will have a "\r\n" sequence at the end of each line.
What would happen if you were to remove the last character from each line and try to display it to the terminal? Now after each line, the cursor would advance to the beginning of the line ("\r") but not advance to the next line. Thus each line will overwrite the other.
This could happen if you have a perl script where 'chomp' is used to remove the last character of each line.
No comments:
Post a Comment