Created
May 18, 2018 00:49
-
-
Save apex-omontgomery/04a1443f0f4d7885870171383316b1f7 to your computer and use it in GitHub Desktop.
split klv of length k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/awk -f | |
# prints each klv based on beginning length on a new line | |
# 012TESTYYYNN014NEWSYYYNNYY | |
# 012TESTYYYNN | |
# 014NEWSYYYNNYY | |
{ | |
for(columIndex=0; columIndex <=length($0); columIndex++) | |
{ | |
currLen = int(substr($1, columIndex, 3) ) | |
print substr($1,columIndex,currLen) | |
columIndex +=currLen | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment