reading undelimited comma numbers
Show older comments
Apologise if this is an already resolved issue but I just cannot find the solution The lab. equipment spits out a .cti file which I try convert to .xlsx format I say try because I am unable to separate the comma delimited number so the rows looks like this:
-20.925926,119.3976
Any suggestion for an approach to read in the number, I have tried using
num = xlsread(filename,sheet,xlRange)
num = xlsread(filename,sheet,xlRange,'basic')
none worked - num returns as an empty array
I am thinking I should try to read in as a string extract the number as a string and convert to numerics
Thanks, Philip
2 Comments
Image Analyst
on 5 Nov 2014
Why do you say "undelimited" in the subject line? That row is delimited. What does "undelimited" mean to you?
per isakson
on 5 Nov 2014
Edited: per isakson
on 5 Nov 2014
Can you upload a sample file (paper-clip-button)? I understand that cti-file is a text file, but that's about all. Matlab Interface User’s Guide doesn't help.
Accepted Answer
More Answers (1)
Kelly Kearney
on 5 Nov 2014
1 vote
Trying to convert to an Excel format seems unnecessary and complicated... if you're planning to work with this data in Matlab only, I'd suggest skipping that step.
Can you show a few snippets of your file? In plain text. Are the comma-delimited portions of the file all one line, or are there a certain number of columns per row? Are all the data points in quoted pairs, or is that unique to line 16016?
2 Comments
Kelly Kearney
on 5 Nov 2014
Okay, first off, this isn't a comma-delimited file... it's a text file with a few comma-delimited sections. So you're going to have to read it as such, parsing each section appropriately. A quick google search of the CITIFILE format suggests that the data portions of the file will be indicated by BEGIN and END keywords; is that the case in your file?
Categories
Find more on Tables 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!