The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



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
delete a special character in file srivsn Shell Programming and Scripting 1 03-15-2006 06:45 AM
delete a special character in file srivsn Shell Programming and Scripting 3 03-07-2006 08:18 AM
Problem deleting file with special character hart1165 UNIX for Dummies Questions & Answers 2 12-07-2005 11:29 AM
Mount a character special file MuellerUrs SUN Solaris 1 07-15-2005 12:36 PM
special character ? mile1982 High Level Programming 1 10-19-2004 08:15 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-05-2007
Ryan2786 Ryan2786 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 6
Special character in my file

I have a special character in my file. It displays as a '#' sign but when I do this command I do not find the line.

fgrep 'G#ant' file1

I want to replace the special character with another value but I need to know what character it really is. Any ideas on how to replace this '#' value with a space. I tried

sed 's/G#ant/G ANT/g' file1> file2

but it does not work.
thanks for any help.
Ryan
  #2 (permalink)  
Old 07-05-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Try
Code:
sed 's/G.ant/G ANT/g' file1> file2
You can use 'od' to find out what the character is.

Cheers,
ZB
  #3 (permalink)  
Old 07-05-2007
Ryan2786 Ryan2786 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 6
Thanks. the sed command worked great.

how do I use the od command to get the hex values for that line?
thanks.
Ryan
  #4 (permalink)  
Old 07-05-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
'man od' yields:
Code:
     -x    Interpret words in hex.  This is equivalent to -t x2.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:21 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0