How to read comma separated input data containing values & stings which also has ',' & ';' used for separation?

3 ビュー (過去 30 日間)
Shree
Shree 2015 年 3 月 11 日
コメント済み: Shree 2015 年 3 月 12 日
How to read comma separated input data containing values & stings which also has ',' & ';' used for separation?
Example:
#SATVISA,COM1_30,0,88.5;COARSESTEERING,1833,167463.000,00400000,0947,12996;TRUE,TRUE,30,16,0,0,79.0,111.5

採用された回答

dpb
dpb 2015 年 3 月 11 日
doc textscan % NB: 'delimiter' Name-Value Pair with example for multiple delimiter characters.
  6 件のコメント
dpb
dpb 2015 年 3 月 12 日
Use the 'collectoutput',1 name-value pair to put the string and numeric data into separate (still cell) arrays. Again I repeat, you can not put the two types of data in the same array; just not possible.
You can then use cell2mat on the numeric array to get a regular array of numeric values; again you leave out pertinent details of what data are to go together for plotting, etc., so that's a detail to deal with.
Or, of course, to use the cell array as is, you "use the curlies" the {} brackets to dereference the content of a cell. Read the doc on cell arrays for the details there.
Again, specific examples of what you want to do help more than just generalizations.
Shree
Shree 2015 年 3 月 12 日
I will try this approach. Thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by