How Do I Remove Special Characters in Linux?
Contents How Do I Remove Special Characters from a File in Linux? Remove Ctrl-M Characters from a File in Unix the Easiest Way Is Probably to Use the Stream...
Contents
How do I remove special characters from a file in Linux?
Remove CTRL-M characters from a file in UNIX
- The easiest way is probably to use the stream editor sed to remove the ^M characters. Type this command: % sed -e “s/^M//” filename > newfilename. …
- You can also do it in vi: % vi filename. Inside vi [in ESC mode] type: :%s/^M//g. …
- You can also do it inside Emacs.
Must Read
How do you remove special characters from a script?
How do I remove special characters from a string?
- public class RemoveSpecialCharacterExample1.
- {
- public static void main(String args[])
- {
- String str= “This#string%contains^special*characters&.”;
- str = str.replaceAll(“[^a-zA-Z0-9]”, ” “);
- System.out.println(str);
- }