29 lines
322 B
Perl
Executable File
29 lines
322 B
Perl
Executable File
#!/usr/bin/env perl
|
|
|
|
$s = 0;
|
|
$n = 0;
|
|
|
|
while (<>) {
|
|
s/^\s*(.*)$/\1/g;
|
|
if (m/^\s*$/) { next; }
|
|
if ($s) {
|
|
if (m/''/) {
|
|
s/^([^#]*)\R+$/\1/g;
|
|
$s = 0;
|
|
}
|
|
} else {
|
|
if (m/''/) {
|
|
$s = 1;
|
|
} else {
|
|
s/^([^#]*)\R+$/\1/g;
|
|
}
|
|
if (!$n || m/^,/) {
|
|
$n = 1;
|
|
} else {
|
|
print " ";
|
|
}
|
|
}
|
|
print;
|
|
}
|
|
print "\n";
|