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

1 view (last 30 days)
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 Comments
Divyajyoti Nayak
Divyajyoti Nayak on 19 Oct 2024
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 on 20 Oct 2024
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.

Sign in to comment.

Accepted Answer

Stephen23
Stephen23 on 20 Oct 2024
Edited: Stephen23 on 20 Oct 2024
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

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!