How do I remove unwanted strings from a table imported from excel?
Mostrar comentarios más antiguos
I read an excel table that contains 5 columns of values and 1 column of string. I want to remove some text from the string column such that if the text stands all alone on a line, the entire row is deleted.Please, see the attached file.
In the worksheet, I want to remove "<Thread>", "<ThreadID>289123_4_3</ThreadID>","<InitPost>" etc.
Respuestas (1)
Image Analyst
el 25 de Feb. de 2014
0 votos
Attach the workbook and your calls to readtable() . If you don't have the latest MATLAB and are having to use xlsread() instead, then let us see your code, or else upgrade where this will be a lot easier.
4 comentarios
Adekunle Obasa
el 27 de Feb. de 2014
Image Analyst
el 27 de Feb. de 2014
I don't know what cellismemberlegacy() is. Those look like bad names. The first cell array is not header material and the second is not y and the third x, it's really
[numbersOnly, textOnly, everything] = xlsread(.....
You should probably only use the everything cell array because that's the only one where the row and column numbers of the numbers and text are synced up. If you use the first two, they're not. That's why it's so much better to use readtable. Do you have R2013b?
Adekunle Obasa
el 28 de Feb. de 2014
Image Analyst
el 28 de Feb. de 2014
Well, in general, to remove something, set that element to [].
Categorías
Más información sobre Spreadsheets en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!