How to separate an Excel column into two columns?

조회 수: 3 (최근 30일)
Lexington Stoyell
Lexington Stoyell 2018년 2월 14일
댓글: Jan 2018년 2월 20일
I have a column in an Excel sheet that I would like to separate into two columns. The numbers are separated by a comma (Ex. [1, 4]). I would like one column to contain the 1 and the other the 4.
This column could also consist of matrices...looking like {[1, 4], [3, 6]}...I would also like to separate these into two different columns; one containing the 1 and 3, the other the 4 and 6.
I would like to know how to separate a column into two columns by the comma between the two numbers...
  댓글 수: 8
Bob Thompson
Bob Thompson 2018년 2월 15일
Ok, so depending on the data type inside the cell you can go back to the original suggestion for string manipulation. You just need to have an index to make sure you are looking inside your cell.
Jan
Jan 2018년 2월 20일
@Lexington: Your question is still not clear. Does it concern Excel or Matlab? "[1, 4] or {[1, 4], [3, 6]}" This is a substantial difference. While the first is a vector, the second is a cell, which contains two vectors. Therefore I do not have an idea about what your inputs are and what you want as output.
separate a column into two columns by the comma between the two numbers
This is not meaningful, because the vectors do not contain a comma. This comma is just inserted for the output on the screen. A vector consists of 2 elements only, not of square brackets or commas. "Columns" are something you know from Excel, but this is a Matlab forum and here a "column" is not a known object. Change your point of view to arrays, not columns.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by