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

1 visualización (últimos 30 días)
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 comentarios
Divyajyoti Nayak
Divyajyoti Nayak el 19 de Oct. de 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 el 20 de Oct. de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 20 de Oct. de 2024
Editada: Stephen23 el 20 de Oct. de 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

Más respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by