How to separate a column which has a comma separated values, into 2 different values?
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello, Who knows how to separate this column into the name of the city and state (comma-separated value)? and then I need to add this new column to my current table, so I would love to know, thanks in advance!
댓글 수: 0
답변 (1개)
Voss
2023년 2월 2일
city = ["Abilene, TX"; "Waco, TX"; "Arcata/Eureka, CA"];
t = table(city)
city_state = split(t.city,", ");
t.city = city_state(:,1);
t.state = city_state(:,2);
t
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!