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 Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 01:09 PM
Finding Hidden files and protecting the folder containing hidden files from deletion pochaw Shell Programming and Scripting 4 12-22-2007 01:33 AM
Hidden Characters Khoomfire UNIX for Advanced & Expert Users 6 07-06-2007 04:40 AM
missing hidden characters SUSANR9999 UNIX for Dummies Questions & Answers 2 11-09-2006 04:30 PM
Hidden passwords neto Shell Programming and Scripting 2 09-21-2005 01:09 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 07-23-2008
Khoomfire Khoomfire is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 68
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
  #2 (permalink)  
Old 07-23-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
od or hexdump or xxd perhaps?
  #3 (permalink)  
Old 07-23-2008
Khoomfire Khoomfire is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 68
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.
  #4 (permalink)  
Old 07-23-2008
Khoomfire Khoomfire is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 68
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.
  #5 (permalink)  
Old 07-23-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
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.
  #6 (permalink)  
Old 07-23-2008
Khoomfire Khoomfire is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 68
Cheers Era
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:20 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