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 > 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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to remove all except one file? praveen_b744 UNIX for Dummies Questions & Answers 5 03-01-2009 02:56 PM
rm command not able to remove file jambesh Shell Programming and Scripting 7 12-21-2007 07:37 AM
remove file bkan77 UNIX for Advanced & Expert Users 2 09-08-2007 05:10 PM
Remove the contents of a file without deleting the file sumesh.abraham Shell Programming and Scripting 10 12-02-2006 05:35 PM
help to remove file ranj@chn UNIX for Dummies Questions & Answers 2 06-16-2006 05:03 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 08-07-2006
sayonm sayonm is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 30
how to remove ^@ from a file using sed...or anything

i tried the following:-
sed -e file 's/^@//g' > temp

also tried
sed -e file 's/[^ -~]//g' > temp

nothing happened....can someone please tell me wht is wrong???
also someinformation abt the character "^@"(it is ONLY ONE character and NOT TWO characters)

thanx in advance..
  #2 (permalink)  
Old 08-07-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
'^@' is ascii octal '000'
tr -d '\000' myFile
  #3 (permalink)  
Old 08-07-2006
dsravan dsravan is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 188
Vgresh,

It's giving me following error.

tr -d '\000' a(my file name)


tr: The combination of options and String parameters is not legal.
Usage: tr [ -c | -cds | -cs | -ds | -s ] [-A] String1 String2
tr [ -cd | -cs | -d | -s ] [-A] String1
  #4 (permalink)  
Old 08-07-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
sorry - fat fingers:
Code:
tr -d '\000' < myFile
  #5 (permalink)  
Old 08-07-2006
xb88 xb88 is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 7
try this:

cat <your_file_name> | sed -e 's/\^@//g' > output.txt
  #6 (permalink)  
Old 08-07-2006
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,122
Quote:
Originally Posted by xb88
try this:

cat <your_file_name> | sed -e 's/\^@//g' > output.txt
  1. why do you need 'cat'?
  2. '^@' is ONE character. How exactly does using the '\' help you
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 06:26 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