Skip to content
Snippets Groups Projects
Commit 6c9e967f authored by Nicola Vigano's avatar Nicola Vigano
Browse files

Perl updated "trailing whitespaces killer" to handle multiple files in one go


Signed-off-by: default avatarNicola Vigano <nicola.vigano@esrf.fr>

git-svn-id: https://svn.code.sf.net/p/dct/code/trunk@817 4c865b51-4357-4376-afb4-474e03ccb993
parent 60dcb521
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl
print "Kill trailing whitespaces in file: $ARGV[0]\n\n";
foreach $file (@ARGV) {
print "Kill trailing whitespaces in file: $file\n";
$file = <$ARGV[0]>;
open(INFO, $file);
@lines = <INFO>;
close(INFO);
open(INFO, $file);
@lines = <INFO>;
close(INFO);
foreach $line (@lines) {
$line =~ s/\t/ /g;
$line =~ s/(\s*)$/\n/;
}
foreach $line (@lines) {
$line =~ s/\t/ /g;
$line =~ s/(\s*)$/\n/;
}
open(INFO, ">$file");
print INFO @lines;
close(INFO);
open(INFO, ">$file");
print INFO @lines;
close(INFO);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment