record of file

1 次查看(过去 30 天)
huda nawaf
huda nawaf 2012-1-8
hi,
is there function deal with file such record of file ?
i.e. my file with very large size, can I deal with file directly instead of using arrays.
thanks in advance

回答(2 个)

Image Analyst
Image Analyst 2012-1-8
How large are your files? How large would your arrays be? Hundreds of megabytes? What do you mean by "deal with"? How about fopen, fgetl, fread, etc.?
  1 个评论
huda nawaf
huda nawaf 2012-1-8
thanks,
yes, hundreds of megabytes.
I mean read file .
my files contains rows with different lengths.
when read it as arrays , zeros will be inserted in empty cells of array, so become so large.
can structure do with file? then each record assigned for one row.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2012-1-8
You would have to write routines yourself to handle this.
There is no mechanism to position to a particular line number in a text file. The closest you can get to that is to read the file ahead of time looking for each beginning of line and recording the value of ftell() at the beginning of line. Then to position to a given line, you would index the recorded values at the line number and fseek() to that recorded position.
The MATLAB- provided routines that can deal with files as structures only work with binary files.
If you happen to have R2011b, then there is a new matfile object that can work with version -7.3 .mat files in order to retrieve an array location from a variable.
  2 个评论
huda nawaf
huda nawaf 2012-1-9
thanks,
I have r2011a , can I update it or I have to install new one?
Walter Roberson
Walter Roberson 2012-1-9
You would have to install a new one.
Note: The *b releases are never available in Student Version.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by