diff options
author | Michael Moon <triffid.hunter@gmail.com> | 2012-09-26 12:49:42 +0400 |
---|---|---|
committer | Michael Moon <triffid.hunter@gmail.com> | 2012-09-26 12:49:42 +0400 |
commit | ab103b0c12551b0fc1ee43f76da07dd9d709235f (patch) | |
tree | 03b0fcc3aa457178c893635d2f57d1c493455089 | |
parent | 36a5af831c453dc48f72a0511533448dae5d2dab (diff) |
a few minor updates for z-every-line
-rwxr-xr-x | utils/post-processing/z-every-line.pl | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/post-processing/z-every-line.pl b/utils/post-processing/z-every-line.pl index 49d5f4502..aaf57e172 100755 --- a/utils/post-processing/z-every-line.pl +++ b/utils/post-processing/z-every-line.pl @@ -8,17 +8,17 @@ my $z = 0; # read stdin and any/all files passed as parameters one line at a time while (<>) { # if we find a Z word, save it - $z = $1 if /Z(\d+(\.\d+)?)/; + $z = $1 if /Z\s*(\d+(\.\d+)?)/; # if we don't have Z, but we do have X and Y if (!/Z/ && /X/ && /Y/ && $z > 0) { # chop off the end of the line (incl. comments), saving chopped section in $1 - s/\s*([\r\n\;\(].*)//s; + s/\s*([\r\n\;\(].*)/" Z$z $1"/es; # print start of line, insert our Z value then re-add the chopped end of line - print "$_ Z$z $1"; + # print "$_ Z$z $1"; } - else { + #else { # nothing interesting, print line as-is - print; - } + print or die $!; + #} } |