Import .csv that has the characters '-'

3 Ansichten (letzte 30 Tage)
Raldi
Raldi am 23 Mär. 2014
Bearbeitet: per isakson am 23 Mär. 2014
I have an .csv file as you can see below and was wondering how to import it into matlab. 'csvread' wont work from what I've tried. Thanks for any help you might offer.
Date,Open,High,Low,Close,Volume
23-Mar-10,40.90,41.50,40.74,41.30,44335408
22-Mar-10,38.90,41.03,38.80,40.40,50007926
19-Mar-10,40.30,40.50,39.00,39.00,55803035
18-Mar-10,40.90,40.90,40.00,40.20,35021589
17-Mar-10,41.00,41.70,39.90,40.50,68063581
16-Mar-10,39.50,40.68,39.20,40.50,54320539
15-Mar-10,38.80,39.40,38.30,38.90,63595754

Akzeptierte Antwort

per isakson
per isakson am 23 Mär. 2014
Bearbeitet: per isakson am 23 Mär. 2014
Not tested:
fid = fopen( 'filename.csv' );
cac = textscan( fid, '%s%f%f%f%f%f', 'delimiter', ',', 'headerlines', 1 )
fclose(fid);
and
sdn = datenum( cac{1}, 'dd-mmm-yy' );
.

Weitere Antworten (0)

Kategorien

Mehr zu Data Import and Export finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by