20070702 remove spaces in a file - plembo/onemoretech GitHub Wiki

title: remove spaces in a file link: https://onemoretech.wordpress.com/2007/07/02/remove-spaces-in-a-file/ author: lembobro description: post_id: 678 created: 2007/07/02 16:18:00 created_gmt: 2007/07/02 16:18:00 comment_status: open post_name: remove-spaces-in-a-file status: publish post_type: post

remove spaces in a file

Here's another one from my colleague, engineer Gary Utz. With this one-liner you can strip all the blank lines out of a file. Very useful.

perl -pi -e 's/^(s)*$//'

So much for Perl not being a text editor.

Copyright 2004-2019 Phil Lembo