How to read a complex alphanumeric string or cell
古いコメントを表示
Hi, I've some troubles to generate a code to read a complex (for me) alphanumeric string (or cell).
I've a cell (4000x1) with a text file like this: 'Daily_cum_2013_05_30_09_59__2013_05_31_10_05.asc' I want to separate the two dates (2013-05-30 09:59 and 2013-05-31 10:05) and convert it to a date format.
I tryed with sscanf, strread, textscan comands, but I don't succeed. Like:
test = sscanf(text,'%*s %d'); %to not consider the first part of text
but it doesn't work.
Is it so difficult ?
Thanks in advance
Stefano
採用された回答
その他の回答 (1 件)
Stefano Alberti
2016 年 2 月 10 日
0 投票
3 件のコメント
Walter Roberson
2016 年 2 月 10 日
datestr( regexprep(sC, {'Daily_cum_', '\.asc'}, {'',''}) )
Stefano Alberti
2016 年 2 月 11 日
編集済み: Stefano Alberti
2016 年 2 月 11 日
Stefano Alberti
2016 年 2 月 11 日
編集済み: Stefano Alberti
2016 年 2 月 11 日
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!