How to extract results from multiple simulation files and save them into txt file

matlabsave
txt
savetofile
write

#1

If you have large amount of simulations that contain certain results, you might want to use a script to open each simulation file and save the results into a file of one of the supported formats.
The example script below shows how to extract broadband transmission results from multiple files and save it into a *.txt file that is very versatile and can be imported by many 3rd party tools.

Note that the data is first saved into a matrix, that is easier to manipulate. After the data is collected from all simulation files, the matrix is saved into a *.txt file where each column represents Transmission results from one simulation file. The very first column then represents the frequency/x axis data and it assumes that the dimension of all datasets is identical.

You can download the example script file and related simulation files with the results here:
Save data script.lsf (817 Bytes)
file_1.fsp (2.2 MB)
file_2.fsp (2.6 MB)
file_3.fsp (2.0 MB)

Note:
If you wish to save the final matrix into a Matlab file, use matlabsave(); command instead of write();


여러 시뮬레이션 파일로부터 데이타를 추출하고 텍스트 파일로 결과를 저장하는 방법
DFB Laser: How extract the data to txt. file
Writing a text file from multiple input argument