home *** CD-ROM | disk | FTP | other *** search
- /* Create an ASCII file from a binary file for use in MediaPoint*/
- /* This example can e.g. be used to extract stock information and
- save it as a file which can be crawled */
-
- ADDRESS COMMAND
- OPTIONS RESULTS
-
- CALL OPEN('infile','m:arexx/rek2.dbf','R') /*Open the binary file*/
- CALL OPEN('outfile','ram:CrawlFile','W') /*Open the new file*/
- OFFSET=256 /*Skip the header?*/
- streamin = READCH('infile',2000) /*Read 2000 bytes from file*/
-
- do i = OFFSET to 2000
- CALL Filter(i) /*Filter out obsolete bytes*/
- end
- exit
-
- Filter:
- arg(i)
- IF C2D(substr(streamin,i,1))>47 then /*Only text and digits*/
- IF C2D(substr(streamin,i,1))<123 then
- CALL WRITECH('outfile',substr(streamin,i,1))
- IF C2D(substr(streamin,i,1))=32 then /*Keep the spaces*/
- CALL WRITECH('outfile',D2C(10))
- return
-
-