The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Hidden control characters in a Unix Text File! kewl_guy Shell Programming and Scripting 6 09-30-2008 10:09 AM
Finding Hidden files and protecting the folder containing hidden files from deletion pochaw Shell Programming and Scripting 4 12-21-2007 10:33 PM
Hidden Characters Khoomfire UNIX for Advanced & Expert Users 6 07-06-2007 01:40 AM
missing hidden characters SUSANR9999 UNIX for Dummies Questions & Answers 2 11-09-2006 01:30 PM
Hidden passwords neto Shell Programming and Scripting 2 09-21-2005 10:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-23-2008
Registered User
 

Join Date: Aug 2005
Posts: 67
hidden Characters

Hello All,
I'm trying to parse through a file and display all the hidden characters, including all carriage and line returns. I usually use cat -v, but this doesn't display the carriage and line returns. Does anyone know how this can be done?

Thanks
Khoom
Reply With Quote
Forum Sponsor
  #2  
Old 07-23-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
od or hexdump or xxd perhaps?
Reply With Quote
  #3  
Old 07-23-2008
Registered User
 

Join Date: Aug 2005
Posts: 67
Era, all those help me to view the hidden characters. However in this case I'd also like to insert a newline or a carriage return, that's why I need an editor that will enable me both to view and to edit this file.
Reply With Quote
  #4  
Old 07-23-2008
Registered User
 

Join Date: Aug 2005
Posts: 67
Just to clarify things - I have a file with all the lines ending with \n\r when viewed with od -c. However, one line ends with just \n. I'd like to insert the \r character because the file is failing to process because of this missing character.
Reply With Quote
  #5  
Old 07-23-2008
era era is offline
Herder of Useless Cats
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,650
Presumably you mean \r\n not the other way around.

Code:
perl -i~ -pe 's/\r?\n/\r\n/' file
Similar solutions for sed and awk and what not are available; search the forums.
Reply With Quote
  #6  
Old 07-23-2008
Registered User
 

Join Date: Aug 2005
Posts: 67
Cheers Era
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:33 PM.


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

Content Relevant URLs by vBSEO 3.2.0