Reading large csv files with lines containing commas as one field

I have a big one . CSV file (~ 26000 lines). I want to be able to read it in Matlab. Another problem is that it contains a collection of strings separated by commas in one .

I have trouble reading. I tried things like tdfread which do not work here. Any tricks with textscan should i know?

Is there another way?

+3
source share
6 answers

I'm not sure what your CSV file is generating, but this is your problem.

CSV , . CSV , . ANY , ?

CSV . / . - "()), , .

, CSV.

+2

, xlsread , , - , ? ( :-),

fid = fopen('yourfile.csv');

textscan

t = textscan(fid, '%s', delimiter', sprintf('\n'));
t = t{1};

fgetl ( ).

- textscan , , , .

+1

, .csv, . Excel , , Excel. CSV DB-. , matLab , - .

? , ? , ?

0

, , CSV , , Matlab, . , , , , , , . Matlab , .

, , .

0

Unix? , , , , ​​ sed , Matlab. , , .

0

:

path='C:\folder1\folder2\';
data = 'data.csv';
data = dataset('xlsfile',sprintf('%s\%s', path,data));

, :

[data,path] = uigetfile('C:\folder1\folder2\*.csv');
data = dataset('xlsfile',sprintf('%s\%s', path,data));

. , 1 -

( (1))

0

Source: https://habr.com/ru/post/1730714/


All Articles