Grep Values from a file.

버전 1.1.0.0 (9.19 KB) 작성자: Anver Hisham
Function to grep values of a parameter from an input file to matrix. Supports multiline grepping.
다운로드 수: 612
업데이트 날짜: 2013/12/23

라이선스 보기

Examples:
1. To grep parameter 'a' from file 'file1.txt' which contains numbers as "a=[1 2 3]",
a = grepValues('file1.txt','a');
2. To grep parameter 'a' from file 'file1.txt' which contains string as "a= citizen kane",
clear options;
options.targetType='string';
a = grepValues('file1.txt','a',options);
3. To grep all parameters ending on 'a', input a PERL-REGEX pattern as parameter name,
clear options;
options.parameterType='PREGEX';
a = grepValues('file1.txt','\w*a',options);
4. To count the occurances of all parameters ending on 'a', make searchMode as 'countOnly'
clear options;
options.parameterType='PREGEX';
options.searchMode='countOnly';
a = grepValues('file1.txt','\w*a',options);

For more info, see the comments on top of file.

MATLAB release: MATLAB 6.5 (R13)
Other requirements: Thoroughly tested in the Linux environment, in R12 and R13. For other platforms, Perl 5 is required.

인용 양식

Anver Hisham (2024). Grep Values from a file. (https://www.mathworks.com/matlabcentral/fileexchange/43871-grep-values-from-a-file), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

Minor Bug fixed, which prevented grepping of double quoted matrices.

1.0.0.0