Set Size File Text on Matlab
Ältere Kommentare anzeigen
Hi everyone, I have program that load text file using uigetfile :
[filepesan lokasi] = uigetfile({'*.txt'},'Browse file message');
this is capacity for file if text file is bigger than capacity
kapasitas=get(handles.txt_nkapaembed,'String');
kapa=str2num(kapasitas);
and codes for get text file size is
txtpesan = strcat(lokasi,filepesan);
infofile=dir(txtpesan);
file=infofile.bytes;
set(handles.txt_nukurfile,'String',num2str(file));
if (file >= kapa)
msg=strcat(num2str(kapa),{' bytes only will embed});
msgbox(msg,'warning','warn');
return
end
but in my algorithm program is that when text file is bigger than "kapasitas" size (ex. 100Kb), the text file should be "crop" until length of 100Kb.
how can I do that? need your advice, many thanks
2 Kommentare
Walter Roberson
am 3 Feb. 2014
You have not shown your code for reading the file.
Bakka
am 3 Feb. 2014
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Scripts finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!