program nohigh(input, output); (* nohigh: remove high order bit characters from a file Dr. Thomas D. Schneider National Institutes of Health National Cancer Institute Center for Cancer Research Nanobiology Program Molecular Information Theory Group Frederick, Maryland 21702-1201 toms@ncifcrf.gov permanent email: toms@alum.mit.edu (use only if first address fails) http://www.ccrnp.ncifcrf.gov/~toms/ module libraries: delman, prgmods *) const (* begin module version *) version = 1.00; (* of nohigh.p 2006 Mar 01 2006 Mar 01, 1.00: origin from wtch.p *) (* end module version *) (* begin module describe.nohigh *) (* name nohigh: remove high order bit characters from a file synopsis nohigh(input: in, output: out) files input: the file to be stripped of high characters output: the stripped file description The program nohigh removes all characters with ascii values greater than or equal to 126. see also wtch.p author Thomas Schneider bugs none known technical notes The constant maxchars determines the number of characters accepted. *) (* end module describe.nohigh *) procedure themain(var fin, fout: text); const CR = 13; (* carriage return *) TAB = 09; (* tab character *) SPACE = 32; (* space character *) HIGH = 126; (* high order bit is on if greater than this value *) var c: char; (* a character from the input to process *) begin (* nohigh *) (* initialize *) (* writeln(fout,'** nohigh ',version:4:2); *) (* Note: cannot reset standard input file *) while not eof(fin) do begin if eoln(fin) then begin readln(fin); writeln(fout); end else begin read(fin,c); if ord(c) < HIGH then write(fout,c) end end; end; begin themain(input, output); end. (* nohigh *)