I'm trying to read a text file into an associative array. For example, 'text.txt' contains
1. ABC
2. XYZ
I'd like to read this text file and print them out such such Array[0] is 1. ABC and Array[1] is 2. XYZ
I have 6 lines of input in total!
Here is what I have right now
program readText
OPEN(1,FILE='text.txt')
READ(1, *) A ,B, C, D, E, F
WRITE (*, *) A,B,C,D, E ,F
CLOSE(1)
end program readText
After this i get
Error termination. Backtrace:
#0 0x10bde99ac
#1 0x10bdea645
#2 0x10bdeadd9
#3 0x10bfb3ecb
#4 0x10bfacab6
#5 0x10bfae509
#6 0x10bdddc82
#7 0x10bddde78
Hence, i am not even printing the text file to the screen. After this, I'd like to assign them into an array and print the array. Please let me know what I could do to solve this problem. Thanks!