diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-05 19:01:50 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-05 19:01:50 +0800 |
commit | 8f87e802197c8f6240002c97873da0a43c7995dc (patch) | |
tree | 5ace9ba6cdc51cab46e6b8693526f6bd8eae5dec | |
parent | 5f240af15e191a6bbda8efa73c0fe6ed964fc435 (diff) | |
download | chandra-acis-analysis-8f87e802197c8f6240002c97873da0a43c7995dc.tar.bz2 |
Delete analyze_path.awk
-rw-r--r-- | scripts/analyze_path.awk | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/scripts/analyze_path.awk b/scripts/analyze_path.awk deleted file mode 100644 index 38e3f2a..0000000 --- a/scripts/analyze_path.awk +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/awk -f -# extract `obs_id' and `source name' from path -# -# LIweitiaNux <liweitianux@gmail.com> -# 2013/02/04 -# -# input: -# path that include `oi' and `source name' -# e.g.: -# -# output: -# - -# main part -{ - if (NF==1) { - ## oi & name - input=($1 "/") - if (input ~ /_oi/) { - ## PATTERN: .../$name_oi$oi/... - idx_oi = match(input, /oi[0-9]+/) + 2; # `2' skip the `oi' - len_oi = RLENGTH - 2; - oi = substr(input, idx_oi, len_oi); - idx_name = match(input, /\/[a-zA-Z0-9.+-]+_oi/) + 1; - len_name = RLENGTH - 4; - name = substr(input, idx_name, len_name); - } - else { - ## PATTERN: .../$name/$oi/... - idx_oi = match(input, /\/[0-9]+\//) + 1; - len_oi = RLENGTH - 2; - oi = substr(input, idx_oi, len_oi); - idx_name1 = match(input, /\/[a-zA-Z0-9_.+-]+\/[0-9]+\//); - len_name1 = RLENGTH; - name1 = substr(input, idx_name1, len_name1); - idx_name = match(name1, /\/[a-zA-Z0-9_.+-]+\//) + 1; - len_name = RLENGTH - 2; - name = substr(name1, idx_name, len_name); - } - ## output - printf("input: %s\n", input) - printf("oi: %s\nname: %s\n", oi, name) - } - else { - printf("*** WARNING: invalid input: %s\n", $0) - } -} -# END - |