![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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 |
| Forum Sponsor | ||
|
|
|
#9
|
||||
|
||||
|
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. |
||||
| Google The UNIX and Linux Forums |