LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2007, 05:18 AM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 590

Rep: Reputation: 34
control characters in vi


Can someone tell me how to find control characters in vi text file

thank you

Asanka
 
Old 08-30-2007, 06:09 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 39
You can enter control characters in Vi by typing Ctrl+V first, followed by Ctrl+character. e.g.
Ctrl+v Ctrl+m will put a ^M in the file.
Follow the same procedure to find/replace control characters.
 
Old 08-30-2007, 07:15 AM   #3
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 590

Original Poster
Rep: Reputation: 34
Hi arungoodboy

Thank you for the info

Lets say somehow or the other a control character has gone in to the file and it is not visible if I want to find and get read of this character what do I have to do. Is there a way to bring this out.

Thank you

Asanka
 
Old 08-30-2007, 10:29 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
If you know which char you are looking for, use the prev advice.
Otherwise, try the od or hexdump tool (for a small file).
For a large file you might need to write a script in eg Perl.
 
Old 08-30-2007, 11:52 PM   #5
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 590

Original Poster
Rep: Reputation: 34
Thanks guys
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tc traffic control tc traffic control Linux QoS control tool(noob help) inv|s|ble Linux - General 1 07-26-2007 12:12 PM
Accented Characters and other "foreign language" Characters Mark_in_Hollywood LQ Suggestions & Feedback 2 04-30-2007 07:10 PM
Viewing control characters in a text file dmorse Linux - General 2 01-07-2007 12:10 AM
How to modify the names of files and replace characters with other characters or symb peter88 Linux - General 2 12-10-2006 04:05 AM
Clearing control characters from a text file LinuxLala Linux - General 1 04-07-2006 07:45 AM


All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration