Oct-21-2018, 09:41 AM
Hello friends ,
I save the output of my python code in a txt. file . In this file I have many variables , like x[t][m]...y[t][m]...I[t][m].
For another code ,
1)I need to read just x and y variables in my solution file.
2)I have to flip the for loop while reading .
Let me give you an example:
In solution file it is like this:
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:
x[1][1]=3
x[2][1]=5
x[3][1]=9
x[1][2]=3
x[2][2]=5
x[3][2]=9
I never done this type of reading file with this manner . Can you give some ideas or example ? Thank you so much
I save the output of my python code in a txt. file . In this file I have many variables , like x[t][m]...y[t][m]...I[t][m].
For another code ,
1)I need to read just x and y variables in my solution file.
2)I have to flip the for loop while reading .
Let me give you an example:
In solution file it is like this:
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:
x[1][1]=3
x[2][1]=5
x[3][1]=9
x[1][2]=3
x[2][2]=5
x[3][2]=9
I never done this type of reading file with this manner . Can you give some ideas or example ? Thank you so much