Created
October 29, 2011 02:16
-
-
Save bkamapantula/1324004 to your computer and use it in GitHub Desktop.
Reading text files line by line in AWK - Day 8
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
BEGIN{ | |
# Defining variables | |
arr_index = 0; | |
arr_max = 4; | |
} | |
{ | |
# Stores first and second columns respectively for each row | |
col1[arr_index] = $1; | |
col2[arr_index] = $2; | |
arr_index += 1; | |
} | |
END{ | |
for(arr_index = 0; arr_index < arr_max; arr_index++) | |
{ | |
printf("Column 1 Values = %d, Column 2 = %d\n", col1[arr_index], col2[arr_index]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment