Guidance
指路人
g.yi.org
Software / Reginald / Examples / FileLoad / FileLOAD.rex

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
/* ----------------------------------------------------------------------
 * Load and Process large Text Files
 * ----------------------------------------------------------------------
 */
/* ----------------------------------------------------------------------
 * 1. FUNCDEF DLL
 * ----------------------------------------------------------------------
 */
envdir=DIRECTORY()"\"
err = FUNCDEF('LFILE','32,str',envdir'FILELOAD','LOAD')
err = FUNCDEF('FIND','str,str,str,str',envdir'FILELOAD','FIND')
err = FUNCDEF('GETR','str,32',envdir'FILELOAD','GETRECORD')
/* ----------------------------------------------------------------------
 * 2. Load Text File into Memory
 * ----------------------------------------------------------------------
 */
SAY TIME('l') 'Load File'
count=lfile("PseudoText.txt")
SAY TIME('l') 'Load File Completed, 'count' records, retrieve some records'
/* ----------------------------------------------------------------------
 * 3. Retrieve some of the records
 * ----------------------------------------------------------------------
 */
DO i=1 TO 1500 BY 17
   SAY i getr(i)
END
SAY TIME('l') 'Reading completed, start search string'
/* ----------------------------------------------------------------------
 * 4. Search string, and return record
 * ----------------------------------------------------------------------
 */
record=FIND("FIRST","SEM","NOCASE")
DO UNTIL record='' 
   record=FIND("NEXT","SEM","NOCASE")
   SAY record
END
SAY TIME('l') 'searching completed'
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2010-07-16 20:14:06