- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: using sed to remove special characters
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 05:53 AM
тАО02-05-2004 05:53 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 05:57 AM
тАО02-05-2004 05:57 AM
Re: using sed to remove special characters
special characters require a \@ in the sed statement to make a change.
sed s/steve\@aol.com/steveprotter\@aol.com/g
# not fully tested...
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 05:57 AM
тАО02-05-2004 05:57 AM
Re: using sed to remove special characters
tr -d "\033" myfile.xml > newfile.xml
which strips out the escape character from myfile.xml.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 06:00 AM
тАО02-05-2004 06:00 AM
Re: using sed to remove special characters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 06:00 AM
тАО02-05-2004 06:00 AM
Re: using sed to remove special characters
# tr -d x
where x is/are the special character(s)
# tr -d '\043'
will delete #'s from the file (043 being the octal representation of the ascii value of '#')
# tr -d '\043\243'
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 06:01 AM
тАО02-05-2004 06:01 AM
Re: using sed to remove special characters
will in-place change \234 to \432 everywhere
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-05-2004 06:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2004 03:19 AM
тАО02-06-2004 03:19 AM
Re: using sed to remove special characters
To replace the special characters, you can use the same 'tr' command.
$cat file
Hmm... !This is a warning!
$tr -s '\042' '\041'< file
Hmm... "This is a warning"
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2004 03:40 AM
тАО02-06-2004 03:40 AM
Re: using sed to remove special characters
cat filename|tr -s '\226' '\230\226' >newfile
the command tr -d "\256" filename was giving all sorts of error but I believe piping would solve the error issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2004 04:07 AM
тАО02-09-2004 04:07 AM
Re: using sed to remove special characters
# tr -d "\256" < filename
which should take care of the errors.
2. I *think* that you do not understand tr's -s option. It is *not* about substitution, but about squeezing multiple occurrances of the same character to 1
3. You should asign points to the answers
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2004 04:16 AM
тАО02-09-2004 04:16 AM