Azzera filtri
Azzera filtri

Increasing Buffersize while importing data

14 visualizzazioni (ultimi 30 giorni)
Tinkul
Tinkul il 14 Set 2012
I am importing data from txt file to matlab.But the programmme gives error:"Buffer overflow (bufsize = 4095) while reading string from" I am using textscan command in the programme.So buffer size should be increased.how?

Risposte (1)

per isakson
per isakson il 14 Set 2012
Hint:
textscan( ..., 'BufSize', new_size )
See the help.
  6 Commenti
Tinkul
Tinkul il 14 Set 2012
I m writing like that x=fopen('m.txt','r'); input_text=textscan(x,'%s','bufsize',10^999); A=input_text{1}; y=[A{:}] error: Error using ==> textscan Buffer size must be integer-valued.
Error in ==> mat_hex_dec at 5 input_text=textscan(x,'%s','bufsize',10^999);
per isakson
per isakson il 14 Set 2012
Modificato: per isakson il 14 Set 2012
Do you know how many disks you need to store a file of the size, 10^999 bytes? 10^999 is not exactly "multiply by ten".
How large is the file on disk? You do not need a buffer larger than the file!
Did you try
str = fileread( file_spec );
ix = strfind( str, char(10) );
mx = max( ix );
add
sz = size( str )

Accedi per commentare.

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by