\ email.txt Leo Wong 28 March 02003 fyj + \ Hide e-mail address as html special character codes. \ See usage example at the end of this file include from.txt from tools.txt from string.txt from files.txt \ Return c as a special character code string at PAD : SCC ( c -- PAD u ) S" &#" PAD place (.) PAD append [CHAR] ; PAD cappend PAD COUNT ; \ Return c u to a special character code string at sccPad CREATE sccPad 256 CHARS ALLOT : >SCC ( ca1 u1 -- sccPad u2 ) 0 sccPad C! 0 DO COUNT scc sccPad append LOOP DROP sccPad COUNT ; S" hello@albany.net" string Was Was >SCC string Now 100 k* CONSTANT MaxFileSize \ Adjust as needed CREATE BigPad MaxFileSize CHARS ALLOT \ Replace Was with Now in file a u : srf ( a u -- ) \ "surf" 2DUP R/O OPEN-FILE THROW >R BigPad MaxFileSize R@ READ-FILE THROW >R BigPad R@ Was Now s/r DUP R> R> CLOSE-FILE THROW <> IF 2SWAP create-out write close-out ELSE 2DROP 2DROP THEN ; \ Files to be change are listed, one file per line, in : xFiles \ xFiles 0 PARSE open-in BEGIN readl WHILE srf REPEAT 2DROP close-in ; \ Usage example \ xFiles files.dat