Split table entry into separate columns

I have a table the first column has a string of the format 'ABBV 09/17/2021 120.00 C'. I want to expand the table to 4 additional columns 'ABBV','09/17/2021','120.00','C'

답변 (1개)

Simon Chan
Simon Chan 2022년 1월 6일

0 개 추천

How about the following:
Name = "ABBV 09/17/2021 120.00 C";
Data = "Dummy";
A = table(Name,Data);
A.Name = strsplit(A.Name,' ');
T2 = splitvars(A,'Name','NewVariableNames',{'newName1','newName2','newName3','newName4'})

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2022년 1월 6일

답변:

2022년 1월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by