Effacer les filtres
Effacer les filtres

How to separate an Excel column into two columns?

1 vue (au cours des 30 derniers jours)
Lexington Stoyell
Lexington Stoyell le 14 Fév 2018
Commenté : Jan le 20 Fév 2018
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 commentaires
Bob Thompson
Bob Thompson le 15 Fév 2018
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 le 20 Fév 2018
@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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by