# How to save data to a new file, import the data and then use it

I have a for loop which generates random matrices and then some scalar numbers for example:

For[j = 1, j <= 100, j++,a=RandomState[4];b=RandomState[4];c=Tr[a];d=Tr[b];e=b+c;{a,b,c,d,e}>>>file.csv] data=Import["file.csv path","Data"]

ListLinePlot[data[[All,3]],data[[All,4]]]


I need to save this data to a new file and then import to plot for example c against d and perform some other numerical calculations. I have tried the above however it does not work. Here RandomState is from the QI package.

• What is >>>? Why not use Export? Apr 30 '21 at 14:01
• I just learned that >>> is equivalent to PutAppend. Either use Export/Import or Put/Get. And Put does not write in CSV format, it writes the InputForm of an expression. Check the documentation. Apr 30 '21 at 22:12
• I think there is at least one duplicate to this question. Can you check whether the answer to this question solves your problem? May 1 '21 at 9:49