The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
regex to delete multiple blank lines in a file?
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
regex to delete multiple blank lines in a file?
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
6
(
permalink
)
10-11-2007
radoulov
addict
Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,887
Sure:
everything <>0 in awk is true (you can use whatever you want: 1,2 ... 42 ...), true means use default action, which is print the current record.
You could use this, if you prefer:
Code:
awk -- -42 RS= ORS="\n\n" filename
radoulov
View Public Profile
Find all posts by radoulov
Find radoulov's past nominations received
Find radoulov's present nominations given