mirror of https://github.com/CGAL/cgal
The script I use to cleanup files with leading and trailing empty lines
This commit is contained in:
parent
05840a8f17
commit
732f926025
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# This script-let removes empty lines at the beginning and at the end of the file.
|
||||
#
|
||||
# As complement cleanup, one can also remove trailing white spaces at the end of lines:
|
||||
# perl -pi.bak -e 's/\s+$/\n/' */examples/*/*.cpp
|
||||
|
||||
local($/) = undef;
|
||||
my $text = <>;
|
||||
|
||||
$text =~ s/\A\n+//mg;
|
||||
$text =~ s/\n+\Z/\n/mg;
|
||||
|
||||
print "$text";
|
||||
Loading…
Reference in New Issue