![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| escaping special characters in file name... | lau0001 | Shell Programming and Scripting | 1 | 01-19-2008 08:54 PM |
| Removing special characters in file | srivsn | Shell Programming and Scripting | 6 | 01-03-2008 06:10 AM |
| How to delete a file with special characters | yveslagace | UNIX for Dummies Questions & Answers | 5 | 08-22-2007 11:42 AM |
| how to see special characters in a file using vi | jingi1234 | UNIX for Dummies Questions & Answers | 6 | 10-19-2005 11:57 AM |
| search special characters in a file | cramya80 | UNIX for Dummies Questions & Answers | 2 | 05-13-2005 12:08 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Replace Special characters in a file
Hi,
I have a data like this in a file, 402003279034002000100147626030003300010000000000002000029000000 ær^M^\MÍW^H I need to replace those special char to some other char like # or $ Is there any ways to do it… I tried commands tr,sed and many but it was not able to replace because of the special characters and ^M type of characters I need it to be replaced and also the number of bytes of the file should not be altered. There are lots of similar data in this file… I have to replace all the occurrence of the special characters. I know the start-byte and end–byte of the same |
|
||||
|
You can use POSIX character classes with tr
Code:
tr -s '[:cntrl:]' '#' < filename > newfilename |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|