Increasing Buffersize while importing data
Ältere Kommentare anzeigen
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?
Antworten (1)
per isakson
am 14 Sep. 2012
Hint:
textscan( ..., 'BufSize', new_size )
See the help.
6 Kommentare
Tinkul
am 14 Sep. 2012
per isakson
am 14 Sep. 2012
The documentation does not mention an upper limit AFAIK. Try with a number, which you think is large enough.
Tinkul
am 14 Sep. 2012
per isakson
am 14 Sep. 2012
Try
textscan( ..., 'BufSize', new_size, 'ReturnOnError', false )
What message do you get? Next multiply new_size by ten. What message do you get? Next try
str = fileread( file_spec );
ix = strfind( str, char(10) );
mx = max( ix );
What is the value of mx?
Tinkul
am 14 Sep. 2012
per isakson
am 14 Sep. 2012
Bearbeitet: per isakson
am 14 Sep. 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 )
Kategorien
Mehr zu Dates and Time finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!