PageRenderTime 47ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/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
Possible License(s): BSD-3-Clause, LGPL-2.0
  1. BEGIN {
  2. OFS = "\t"
  3. }
  4. {
  5. id = extract(1, 4) + 0
  6. type = extract(61, 2)
  7. fullName = extract(5, 23)
  8. standardAbbreviation = extract(29, 13)
  9. shortAbbreviation = extract(43, 5)
  10. uspsAbbreviation = extract(49, 4)
  11. print id, \
  12. type, \
  13. fullName, \
  14. standardAbbreviation, \
  15. shortAbbreviation, \
  16. uspsAbbreviation
  17. }
  18. function extract(offset, len) {
  19. result = substr($0, offset, len)
  20. gsub(/^[ ]*/, "", result)
  21. gsub(/[ ]*$/, "", result)
  22. gsub(/\&/, "&", result)
  23. return result
  24. }