join rows in a cell matrix with the row above
Hello,
I am trying to import different .txt files and when the value in column 1 =0 merge that row with the row above So the values in the cells are merged into the singular cell above. These text files will have a consitant format as seen below but the individual values will be different. So needing it to work for all .txt imported.
Example of the matrix:
Col 1 Col 2
X777784 R22,R34,R536,
D253,D273
X654646 D43,D263
Desired Output:
Col 1 Col 2
X777784 R22,R34,R536,D253,D273
X654646 D43,D263Hello,
I am trying to import different .txt files and when the value in column 1 =0 merge that row with the row above So the values in the cells are merged into the singular cell above. These text files will have a consitant format as seen below but the individual values will be different. So needing it to work for all .txt imported.
Example of the matrix:
Col 1 Col 2
X777784 R22,R34,R536,
D253,D273
X654646 D43,D263
Desired Output:
Col 1 Col 2
X777784 R22,R34,R536,D253,D273
X654646 D43,D263 Hello,
I am trying to import different .txt files and when the value in column 1 =0 merge that row with the row above So the values in the cells are merged into the singular cell above. These text files will have a consitant format as seen below but the individual values will be different. So needing it to work for all .txt imported.
Example of the matrix:
Col 1 Col 2
X777784 R22,R34,R536,
D253,D273
X654646 D43,D263
Desired Output:
Col 1 Col 2
X777784 R22,R34,R536,D253,D273
X654646 D43,D263 string matrix manipulation, merge rows MATLAB Answers — New Questions