How do I import numerical entries from an excel sheet as strings?
Show older comments
I have an excel sheet in which I want to extract a column of part numbers. The part numbers are not "numbers" as they contain multiple decimal points and symbols such as 04.613.514/516. I was hoping I could extract the part number column into a vector for later operations. Another issue is maintaining significant digits (for example, part number 324.070 becomes 324.07).
4 Comments
Walter Roberson
on 29 Aug 2018
This can be tricky. Would you have an example sheet for us to test with?
Stephen23
on 29 Aug 2018
@Anna Hughes: please upload a sample workbook by clicking the paperclip button.
dpb
on 29 Aug 2018
Presuming you know which column and that is consistent, shouldn't be hard to do with the detectImportOptions spreadsheet object and setvartype then read with readtable instead of xlsread.
As Walter suggests, providing an input worksheet to look at would be invaluable.
Anna Hughes
on 29 Aug 2018
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!