Feb 13, 2002 #1 kasparov Programmer Feb 13, 2002 203 GB How can I delete multiple (concurrent) empty lines in sed? If I use "sed '/^$/d'" only the first empty line is deleted when more then one occurs together. I'm prepared to use perl if I have to but would rather use sed or another Unix command. Thanks
How can I delete multiple (concurrent) empty lines in sed? If I use "sed '/^$/d'" only the first empty line is deleted when more then one occurs together. I'm prepared to use perl if I have to but would rather use sed or another Unix command. Thanks
Feb 13, 2002 #2 Guest_imported New member Jan 1, 1970 0 your sed statement worked for me, maybe need to make it global by putting a /g at the end? worth a try hth Upvote 0 Downvote
your sed statement worked for me, maybe need to make it global by putting a /g at the end? worth a try hth
Feb 13, 2002 1 Thread starter #3 kasparov Programmer Feb 13, 2002 203 GB Tried adding /g but didn't like that. I'm running on Solaris 8 (SunOS 5.8). I usually use ksh but I also tried it using sh & it did the same thing. Still hoping for a solution ... ! Upvote 0 Downvote
Tried adding /g but didn't like that. I'm running on Solaris 8 (SunOS 5.8). I usually use ksh but I also tried it using sh & it did the same thing. Still hoping for a solution ... !
Feb 13, 2002 #4 CaKiwi Programmer Apr 8, 2001 1,294 US Are you sure the lines are really empty? Maybe they have spaces or tabs on them. CaKiwi Upvote 0 Downvote
Feb 13, 2002 Thread starter #5 kasparov Programmer Feb 13, 2002 203 GB You're right - don't know why but I can't find a space in vi but when I run the file through od it shows one. Sorry about that!! Upvote 0 Downvote
You're right - don't know why but I can't find a space in vi but when I run the file through od it shows one. Sorry about that!!