Skip to content

Instantly share code, notes, and snippets.

@aike
Last active June 10, 2016 02:18
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aike/4743833 to your computer and use it in GitHub Desktop.
Save aike/4743833 to your computer and use it in GitHub Desktop.
#!/usr/bin/nawk -f
BEGIN {
FS="\t"
}
{
for (i in hash)
delete hash[i]
for (i = 1; i <= NF; i++) {
sep = index($i, ":")
key = substr($i, 1, sep - 1)
val = substr($i, sep + 1, length($i) - sep)
hash[key] = val
}
for (i in hash)
print i "=" hash[i]
print "------------"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment