2006|1152662407|coke|7|19:50:44|19:50:49|7.0000
2006|1152662407|coke|7|19:50:49|19:50:54|6.0000
2006|1152662407|coke|7|19:50:54|19:50:59|7.0000
2006|1152662407|coke|7|19:50:59|19:51:04|7.0000
2006|1152662407|coke|7|19:51:04|19:51:09|7.0000
2006|1152662407|coke|7|19:51:09|19:51:14|18.0000
2006|1152662407|coke|7|19:51:14|19:51:19|6.0000
2006|1152662407|coke|7|19:51:19|19:51:24|8.0000
2006|1152662407|coke|7|19:51:24|19:51:29|6.0000
2006|1152662407|coke|7|19:51:29|19:51:34|6.0000
2006|1152662407|coke|7|19:51:34|19:51:39|6.0000
2006|1152662407|coke|7|19:51:39|19:51:44|17.0000
2006|1152662407|coke|7|19:51:44|19:51:49|7.0000
2006|1152662407|coke|7|19:51:49|19:51:54|6.0000
2006|1152662407|coke|7|19:51:54|19:51:59|6.0000
2006|1152662407|coke|7|19:51:59|19:52:04|3.0000
2006|1152662407|coke|7|19:52:04|19:52:09|7.0000
2006|1152662407|coke|7|19:52:09|19:52:14|18.0000
2006|1152662407|coke|7|19:52:14|19:52:19|7.0000
2006|1152662407|coke|7|19:52:19|19:52:24|7.0000
2006|1152662407|coke|7|19:52:24|19:52:29|6.0000
2006|1152662407|coke|7|19:52:29|19:52:34|6.0000
2006|1152662407|coke|7|19:52:34|19:52:39|6.0000
2006|1152662407|coke|7|19:52:39|19:52:44|17.0000
2006|1152662407|coke|7|19:52:44|19:52:49|6.0000
I have the above file, I am using the script from one of the posts. I am trying to print the last column, which is
7.0000
6.0000
7.0000
7.0000
7.0000
BEGIN {
FS="|"
while (getline < "moo") {
NDC11[$2]=$5 ## Store Field 5 in ARRAY NDC11 using 2nd field as the subscript
}
}
#I don't know how to do it, so just hard-coded $1 == "F" here.
$1 == "F" && length(NDC11[$2])>0 {
print NDC11[$2], $8
}
Any help?
Thanks
2006|1152662407|coke|7|19:50:49|19:50:54|6.0000
2006|1152662407|coke|7|19:50:54|19:50:59|7.0000
2006|1152662407|coke|7|19:50:59|19:51:04|7.0000
2006|1152662407|coke|7|19:51:04|19:51:09|7.0000
2006|1152662407|coke|7|19:51:09|19:51:14|18.0000
2006|1152662407|coke|7|19:51:14|19:51:19|6.0000
2006|1152662407|coke|7|19:51:19|19:51:24|8.0000
2006|1152662407|coke|7|19:51:24|19:51:29|6.0000
2006|1152662407|coke|7|19:51:29|19:51:34|6.0000
2006|1152662407|coke|7|19:51:34|19:51:39|6.0000
2006|1152662407|coke|7|19:51:39|19:51:44|17.0000
2006|1152662407|coke|7|19:51:44|19:51:49|7.0000
2006|1152662407|coke|7|19:51:49|19:51:54|6.0000
2006|1152662407|coke|7|19:51:54|19:51:59|6.0000
2006|1152662407|coke|7|19:51:59|19:52:04|3.0000
2006|1152662407|coke|7|19:52:04|19:52:09|7.0000
2006|1152662407|coke|7|19:52:09|19:52:14|18.0000
2006|1152662407|coke|7|19:52:14|19:52:19|7.0000
2006|1152662407|coke|7|19:52:19|19:52:24|7.0000
2006|1152662407|coke|7|19:52:24|19:52:29|6.0000
2006|1152662407|coke|7|19:52:29|19:52:34|6.0000
2006|1152662407|coke|7|19:52:34|19:52:39|6.0000
2006|1152662407|coke|7|19:52:39|19:52:44|17.0000
2006|1152662407|coke|7|19:52:44|19:52:49|6.0000
I have the above file, I am using the script from one of the posts. I am trying to print the last column, which is
7.0000
6.0000
7.0000
7.0000
7.0000
BEGIN {
FS="|"
while (getline < "moo") {
NDC11[$2]=$5 ## Store Field 5 in ARRAY NDC11 using 2nd field as the subscript
}
}
#I don't know how to do it, so just hard-coded $1 == "F" here.
$1 == "F" && length(NDC11[$2])>0 {
print NDC11[$2], $8
}
Any help?
Thanks