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