File: strip-headers

package info (click to toggle)
avrp 1.0beta3-6
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 204 kB
  • ctags: 194
  • sloc: ansic: 2,463; makefile: 40; perl: 6; sh: 5
file content (14 lines) | stat: -rwxr-xr-x 317 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl -wn
#  make it slurp the whole file at once:
undef $/;
#  delete first header:
s/^\n*.*\n+//;
#  delete last footer:
s/\n+.*\n+$/\n/g;
#  delete page breaks:
s/\n\n+[^ \t].*\n\n+(\S+).*\1\n\n+/\n/g;
#  collapse two or more blank lines into a single one:
s/\n{3,}/\n\n/g;
#  see what's left...
print;