Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
# syntax: GAWK -f ASSOCIATIVE_ARRAY_MERGING.AWK
|
||||
#
|
||||
# sorting:
|
||||
# PROCINFO["sorted_in"] is used by GAWK
|
||||
# SORTTYPE is used by Thompson Automation's TAWK
|
||||
#
|
||||
BEGIN {
|
||||
PROCINFO["sorted_in"] = "@ind_str_asc" ; SORTTYPE = 1
|
||||
arr1["name"] = "Rocket Skates"
|
||||
arr1["price"] = "12.75"
|
||||
arr1["color"] = "yellow"
|
||||
show_array(arr1,"base")
|
||||
arr2["price"] = "15.25"
|
||||
arr2["color"] = "red"
|
||||
arr2["year"] = "1974"
|
||||
show_array(arr2,"update")
|
||||
for (i in arr1) { arr3[i] = arr1[i] }
|
||||
for (i in arr2) { arr3[i] = arr2[i] }
|
||||
show_array(arr3,"merged")
|
||||
exit(0)
|
||||
}
|
||||
function show_array(arr,desc, i) {
|
||||
printf("\n%s array\n",desc)
|
||||
for (i in arr) {
|
||||
printf("%-5s : %s\n",i,arr[i])
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue