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
screen control characters ajcannon Shell Programming and Scripting 2 09-18-2007 04:18 AM
Which one is faster to remove control m characters? madhunk Shell Programming and Scripting 11 08-16-2006 12:55 PM
how to replace control characters using sed? hillxy Shell Programming and Scripting 5 10-16-2003 10:12 AM
getting rid of control characters apalex UNIX for Dummies Questions & Answers 2 07-12-2001 02:12 AM
printing control characters mglinsk UNIX for Dummies Questions & Answers 1 09-20-2000 04:42 PM

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 09-29-2002
aravind_mg aravind_mg is offline
Registered User
  
 

Join Date: Sep 2002
Posts: 3
Remove control characters

Hi,
When I do a man and save it into a file, I end up getting a lot of control characters. How can I remove them??
I tried this:
/1,$ s/^H//g
But I get an error saying "no previous regular expression".
Can someone help me with this.

Thanks,
Aravind
  #2 (permalink)  
Old 09-30-2002
saabir saabir is offline
Registered User
  
 

Join Date: Sep 2002
Location: UK
Posts: 65
Try using dos2ux:

dos2ux [file] > [newfile]
  #3 (permalink)  
Old 09-30-2002
ganti ganti is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 25
Please use control-v to print ^ before H..You might have printed
shift 6 .That may correspond to mapped characters in vi mode

:1,$ s/control-v,H//g

GOOD LUCK
  #4 (permalink)  
Old 09-30-2002
Perderabo's Avatar
Perderabo Perderabo is online now Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,115
The vi command that you want is:
:1,$s/.^H//g

And since % is the same as 1,$, I like:
:%s/.^H//g

As ganti (almost) points out the ^H a control-v and a control-h.

And you need that dot. man is using stuff like "_^Hx" to output an underscore, then a backspace and finally an "x". On some devices this will result in an underlined x. If that's not possible, the x will overwrite the underscore. That's why you need to delete the character comes before the ^H.
  #5 (permalink)  
Old 09-30-2002
minazk
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Re: Remove control characters

Aravind,

I presume, you want to save your man pages for future reference or for printing purpose.What I would suggest is to try the following command:
# man ls | col -b > filename

where,
ls - is the command whose man pages are required.
filename - is the name of the file to be saved.

I'm sure this will solve your problem.

Minaz



Quote:
Originally posted by aravind_mg
Hi,
When I do a man and save it into a file, I end up getting a lot of control characters. How can I remove them??
I tried this:
/1,$ s/^H//g
But I get an error saying "no previous regular expression".
Can someone help me with this.

Thanks,
Aravind
  #6 (permalink)  
Old 10-02-2002
aravind_mg aravind_mg is offline
Registered User
  
 

Join Date: Sep 2002
Posts: 3
Hi guys..thanks a lot..that was imensely helpful
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:36 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