The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed remove last 10 characters of a line start from 3rd line minifish Shell Programming and Scripting 7 03-26-2008 01:42 PM
Spurious line feeds ajcannon Shell Programming and Scripting 2 10-29-2007 04:24 AM
Remove header(first line) and trailer(last line) in ANY given file madhunk Shell Programming and Scripting 2 03-13-2006 12:36 PM
line feeds in csv gowrish Shell Programming and Scripting 10 09-01-2005 12:04 PM
carriage return/line feeds pitstop Shell Programming and Scripting 4 11-24-2003 12:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 06-16-2005
Registered User
 

Join Date: May 2002
Location: England
Posts: 8
awk ' {
printf $0
while (length ($0) && substr ($0, length ($0), 1) != "E") {
getline; printf $0
}
if (length ($0) == 0) print "E"; else print ""
}' infile > outfile
Reply With Quote
Forum Sponsor
  #9  
Old 06-16-2005
r2007's Avatar
Registered User
 

Join Date: Jun 2005
Location: China
Posts: 73
gnu sed
Code:
sed -e ':a' -e 's/\r//g; /[^E]$/{N; s/\n//; ta}'

Last edited by r2007; 06-16-2005 at 05:06 PM.
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 05:09 AM.


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