I write the solution of my code on a file and I need to read it for another code. But there is one problem , in the file which saves the solution , the variables are like:
x[1][1]=3 x[1][2]=5 x[1][3]=9 x[2][1]=3 x[2][2]=5 x[2][3]=9
what I need is :
x[1][1]=3 x[2][1]=5 x[3][1]=9 x[1][2]=3 x[2][2]=5 x[3][2]=9
how can I flip the for loop to change the indexes to the other way? I learnt that I can make regex on python but since I could not find a good example of it, I could not apply it. Can you give me an example for how to do it ? Thank you so much