The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to delete a file with special characters yveslagace UNIX for Dummies Questions & Answers 5 08-22-2007 08:42 AM
Special character in my file Ryan2786 UNIX for Dummies Questions & Answers 3 07-05-2007 08:35 PM
delete a special character in file srivsn Shell Programming and Scripting 1 03-15-2006 02:45 AM
Problem deleting file with special character hart1165 UNIX for Dummies Questions & Answers 2 12-07-2005 07:29 AM
Mount a character special file MuellerUrs SUN Solaris 1 07-15-2005 09:36 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-06-2006
Registered User
 

Join Date: Dec 2005
Posts: 32
delete a special character in file

hi

i want to delete a particular character in file.

example

file name:abcsample

abc=bbbqw3/
hidh=ajjqiwio4/
xyx=hakjp/
........../
......./

i want to delete that special character (/) in abcsample file.please give the required commands for my requirement.

thank you
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-06-2006
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,643
Code:
tr -d '/' < sample.txt
Reply With Quote
  #3 (permalink)  
Old 03-06-2006
Registered User
 

Join Date: Dec 2005
Location: India
Posts: 218
using awk

awk -F '/' '{print $0}' abcsample
Reply With Quote
  #4 (permalink)  
Old 03-07-2006
Registered User
 

Join Date: Mar 2006
Posts: 36
You can open the file in VI and from the command mode type %s/\///g and enter. The special character will be replaced by null char.

The trick is to escape the special character (here done by typing a leading back slash before the special char).
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0