searchInFile

版本 1.0.0.0 (919 字节) 作者: Stefan Eireiner
searches blockwise for a string or binary pattern in a file
962.0 次下载
更新时间 2006/4/12

无许可证

SEARCHINFILE searches for a binary or string pattern in a file
OFFSET = SEARCHINFILE(FILE, PATTERN)
OFFSET = SEARCHINFILE(FILE, PATTERN, BLOCKSIZE)

The pattern may be a string or a line vector.

The blocksize is the maximum size in bytes which will be in memory while searching. If no blocksize is given then 10000 is assumed. The advantage of using a blockwise search is that you can search in very big files without using much memory.

The offset is the total offset in bytes to the first place of finding. If nothing was found then OFFSET = []

Example:
offset = searchinfile('bigfile.txt', 'searchstring', 20000);

Reads the file in 20000 Byte steps and searches for the searchstring. If it was found, the total offset to the beginning of the searchstring will be returned.

引用格式

Stefan Eireiner (2024). searchInFile (https://www.mathworks.com/matlabcentral/fileexchange/10717-searchinfile), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R13
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0