how to separate two conjoined number obtained during ripping a piece of data from a large file?

1 次查看(过去 30 天)
hi,
while ripping some data out of a lrge file and writing onto a txt file, I ibtained a number in the 5th row which is combination two numbers. It is as it is in the original file itself. How can I separate this number into two. because I need further calculation on this text file by taking it into an excel sheet. but importing the data into excel jumbles all the data out of order.
  2 个评论
Divyajyoti Nayak
Divyajyoti Nayak 2024-10-19
Hi @Saurav Parmar, the file "series_3_zn_porph2_complex_mesityl_par_wB97XD_200xs.log" isn't provided. Without it, it would be difficult to see the issue.
Saurav Parmar
Saurav Parmar 2024-10-20
Hi Divyajyoti,
I have attached the original file from which data has been ripped. Since the data is related to my research so I have truncated certain parts of it...but the pertinent part related to my question is there in the file. Please have a look and let me know.

请先登录,再进行评论。

采纳的回答

Stephen23
Stephen23 2024-10-20
编辑:Stephen23 2024-10-20
Import the file as fixed-width:
F = 'series_3_zn_porph2_complex_mesityl_par_wB97XD_200xs_rip.txt';
T = readtable(F, "FileType","fixedwidth", "VariableWidths",[28,10,10,10,10,10], "ReadVariableNames",0)
T = 398x6 table
Var1 Var2 Var3 Var4 Var5 Var6 ______________________________ _______ _______ _______ _______ _______ {'Alpha occ. eigenvalues --'} -347.47 -347.47 -42.34 -42.339 -37.315 {'Alpha occ. eigenvalues --'} -37.315 -37.31 -37.31 -37.309 -37.309 {'Alpha occ. eigenvalues --'} -14.447 -14.447 -14.447 -14.447 -14.446 {'Alpha occ. eigenvalues --'} -14.445 -14.445 -14.445 -10.342 -10.342 {'Alpha occ. eigenvalues --'} -10.342 -10.342 -10.34 -10.34 -10.34 {'Alpha occ. eigenvalues --'} -10.34 -10.34 -10.34 -10.34 -10.34 {'Alpha occ. eigenvalues --'} -10.34 -10.34 -10.339 -10.339 -10.339 {'Alpha occ. eigenvalues --'} -10.339 -10.339 -10.339 -10.335 -10.334 {'Alpha occ. eigenvalues --'} -10.334 -10.33 -10.33 -10.33 -10.33 {'Alpha occ. eigenvalues --'} -10.328 -10.328 -10.326 -10.326 -10.326 {'Alpha occ. eigenvalues --'} -10.325 -10.325 -10.325 -10.325 -10.325 {'Alpha occ. eigenvalues --'} -10.325 -10.317 -10.317 -10.317 -10.317 {'Alpha occ. eigenvalues --'} -10.317 -10.317 -10.316 -10.316 -10.315 {'Alpha occ. eigenvalues --'} -10.315 -10.314 -10.314 -10.314 -10.313 {'Alpha occ. eigenvalues --'} -10.313 -10.313 -10.313 -10.313 -10.313 {'Alpha occ. eigenvalues --'} -10.313 -10.313 -10.313 -10.313 -10.313

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by