problem with reading ASCII file

hi all,
I can't read this ASCII file (I was open it in txt form) the problem is in the first character line and in the date form here is part of my data:
DATETIME,TEMP
05/01/2015 00:00,32.30405
05/01/2015 01:00,31.57973
05/01/2015 02:00,30.16488
05/01/2015 03:00,29.79983
05/01/2015 04:00,29.31835
05/01/2015 05:00,30.90964
05/01/2015 06:00,30.69131
05/01/2015 07:00,30.4595
05/01/2015 08:00,31.49672
05/01/2015 09:00,31.00717
05/01/2015 10:00,29.74827
05/01/2015 11:00,29.7883
I started with this command
C = textscan(fid, '%s %f')
s = textscan(text,'%s %f','delimiter','.')
anyone can helps me please! thank you in advance.

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 12 日

0 投票

fid=fopen('fic.txt')
out=textscan(fid,'%s %f','delimiter',',','headerlines',1)
fclose(fid)
datetime=out{1}
temp=out{2}

3 件のコメント

lina
lina 2015 年 6 月 12 日
編集済み: lina 2015 年 6 月 12 日
I got this error :( Invalid file identifier. Use fopen to generate a valid file identifier.
Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 12 日
I used 'fic.txt' as an example, in your case, you have to use the name of your file
lina
lina 2015 年 6 月 13 日
it worked thank you very much

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

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2015 年 6 月 12 日

コメント済み:

2015 年 6 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by