MATLAB Answers

how read .csv file.?

4 views (last 30 days)
pruth
pruth on 18 Feb 2016
Edited: per isakson on 19 Feb 2016
hello, guys. i m using csv file of size - 450mb. i dont know how handle it. .CSV file = 'firms3070014556960011_MCD14ML.csv'
which has data when I opened it in excel I got these 13 columns.
geom lat lon bright scan track acq_date acqtime sat con version brght31 frp
0101000000105839B4C80642400E2DB29DEFA71CC0 -7.164 36.053 328.2 3.6 1.8 10/25/2012 725 Terra 81 5.1 302.4 131.6
0101000000F2D24D6210484240E7FBA9F1D28D21C0 -8.777 36.563 332.8 3.1 1.7 10/25/2012 725 Terra 74 5.1 292.4 154.1
01010000003D0AD7A3709D4240C520B072689124C0 -10.284 37.23 320.2 2.5 1.5 10/25/2012 725 Terra 61 5.1 298.3 34
01010000006F1283C0CA814840E17A14AE47E129C0 -12.94 49.014 329.3 1.7 1.3 10/25/2012 726 Terra 29 5.1 306.6 32
01010000005839B4C8769E4840A69BC420B0722BC0 -13.724 49.238 324.7 1.8 1.3 10/25/2012 726 Terra 78 5.1 304.9 36.6
0101000000713D0AD7A3A04840C1CAA145B6732BC0 -13.726 49.255 321.8 1.8 1.3 10/25/2012 726 Terra 74 5.1 303.7 27.8
010100000039B4C876BE9F4840105839B4C8762BC0 -13.732 49.248 330.2 1.8 1.3 10/25/2012 726 Terra 83 5.1 303.5 56.2
0101000000F6285C8FC2354840A8C64B3789812FC0 -15.753 48.42 322.4 1.7 1.3 10/25/2012 726 Terra 75 5.1 299.2 30.5
01010000002B8716D9CE374840C3F5285C8F822FC0 -15.755 48.436 322.4 1.7 1.3 10/25/2012 726 Terra 75 5.1 299.3 32.8
0101000000333333333313474079E9263108AC2FC0 -15.836 46.15 334.5 1.2 1.1 10/25/2012 726 Terra 86 5.1 308.9 25
01010000004C37894160154740CFF753E3A55B30C0 -16.358 46.167 324.3 1.2 1.1 10/25/2012 727 Terra 77 5.1 302.5 16.4
0101000000B4C876BE9F2A474075931804566E30C0 -16.431 46.333 332.8 1.3 1.1 10/25/2012 727 Terra 85 5.1 304.8 32.4
here I don't know how many rows are there.I just copied some to give you an idea about my data. here I want to open this file read it. and last I want only three columns from this. column 2 column 3 and column 7 i.e lat, long and acq_date. hope u understand.
remember excel could not load whole data...out of limit
  2 Comments
pruth
pruth on 19 Feb 2016
hello, thanks for your reply I have used this
fid= fopen('firms3070014556960011_MCD14ML.csv');
dummy = textscan(fid,'%s','delimiter','\n'); % scan the content of the file
fclose(fid)
but this showing me an "error out of memory."

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 19 Feb 2016
fid= fopen('firms3070014556960011_MCD14ML.csv', 'rt');
dummy = textscan(fid,'%*s%f%f%*s%*s%*s%s%*s%*s%*s%*s%*s%*s', 'delimiter', ',', 'HeaderLines', 1); % scan the content of the file
fclose(fid)
  3 Comments
per isakson
per isakson on 19 Feb 2016
I have used GSplit, a free and reliable file splitter, to split large text files. And in a second step read the file in parts.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!