I do have xml, which do have lines like
#<pdfrwt "2"> n_vars code(1) ... code1(2).... code1(n_vars) code2(1) ... code2(n_vars) code3(1) ... code3(n_vars)</pdfrwt>
So actually, depending in the “n_vars” each time, I do have a sequence of numbers which correspond to three classes, ie code1, code2,code3 and for each of these classes I get “n_vars” entries for each one.. So, how can I smartly read the line in bash (ok, this I know 😉 and get to assign a “n_vars” multidimensional variables ie something like
output1[1]=code1(1)
output1[2]=code1(2)
...
output1[n]=code1(n)
and likewise
output2[1]=code2(1)
..
output2[1]=code2(1)
thanks in advance
Alex
You can read the whole line into an array, then take slices of the array.
Some examples of how to access values: