/* Declaration */
Local Rowset &rs_level0, &rs_level1, &rs_level2, &rs_level3;
Local Row &row_level0, &row_level1, &row_level2, &row_level3;
Local Record &rec1;
/* PROCESSING LEVEL 0 */
&rs_level0 = GetLevel0();
&row_level0 = &rs_level0.GetRow(1);
/* PROCESSING LEVEL 1 */
&rs_level1 = &row_level0.GetRowset(Scroll.LEV1COUNTRY_TBL);
For &i = 1 To &rs_level1.ActiveRowCount
&row_level1 = &rs_level1(&i);
/* PROCESSING LEVEL 2 */
&rs_level2 = &row_level1.GetRowset(Scroll.LEV2_STATE_TBL);
For &j = 1 To &rs_level2.ActiveRowCount
&row_level2 = &rs_level2(&j);
/* PROCESSING LEVEL 3 */
&rs_level3 = &row_level2.GetRowset(Scroll.LEV3_DIST_TBL);
For &k = 1 To &rs_level3.ActiveRowCount
&row_level3 = &rs_level3(&k);
/*GET RECORD*/
&rec1 = &row_level3.LEV3_DIST_TBL;
/*GET FIELD*/
&FIELD1 = &rec1.COUNTRY_DISTNAME.Value;
WinMessage("District Name Is" | &FIELD1);
End-For;
End-For;
End-For;
--recursively find all files in current and subfolders, find needs a starting point, so
--the . (dot) points to the current directory
find . -name "foo*"
--case insensitive
find . -iname "foo*"
--recursive search for text in files in a folder using grep
grep -Rnw '/path/to/somewhere/' -e 'pattern'
-- -r or -R is recursive ; use -R to search entirely
-- -n is line number, and
-- -w stands for match the whole word.
-- -l (lower-case L) can be added to just give the file name of matching files.
-- -e is the pattern used during the search
-- r option is lazy (traverses depth-first, than stops after the first directory)
-- R is greedy (will traverse the entire tree correctly).
--Along with these, --exclude, --include, --exclude-dir flags could be used for efficient
--searching:
--This will only search through those files which have .c or .h extensions:
grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"
-- This will exclude searching all the files ending with .o extension:
grep --exclude=\*.o -rnw '/path/to/somewhere/' -e "pattern"
--For directories it's possible to exclude one or more directories using the --exclude-dir
--parameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching
--*.dst/:
grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/search/' -e "pattern"
-- source:
https://stackoverflow.com/questions/16956810/find-all-files-containing-a-specific-text-string-on-linux