/open-dm-dq/standardizer/other/scripts/extractMasterClueEN.awk
https://bitbucket.org/pymma/mosaic · AWK · 27 lines · 24 code · 3 blank · 0 comment · 0 complexity · bca4072e4269730af1aef12f3de8c3d1 MD5 · raw file
- BEGIN {
- OFS = "\t"
- }
-
- {
- id = extract(1, 4) + 0
- type = extract(61, 2)
- fullName = extract(5, 23)
- standardAbbreviation = extract(29, 13)
- shortAbbreviation = extract(43, 5)
- uspsAbbreviation = extract(49, 4)
-
- print id, \
- type, \
- fullName, \
- standardAbbreviation, \
- shortAbbreviation, \
- uspsAbbreviation
- }
-
- function extract(offset, len) {
- result = substr($0, offset, len)
- gsub(/^[ ]*/, "", result)
- gsub(/[ ]*$/, "", result)
- gsub(/\&/, "&", result)
- return result
- }