Rewrite(Y) ; repeat repeat P(C); Write(Y,C) until B1; Writeln(Y) until B2 

2. Reading a textfde x. Assume that Q (C) denotes the processing of a (next) character c. R denotes an action to be executed upon encountering the end of a line. 

Reset(X); while not eof(X) do begin end while not eoln(X) do begin Read(X,C); Q(C) end; R; Readln(X) 

3. Copying a textfile x to a textfile Y while preserving the line structure of x. 

Reset(X); Rewrite(Y); While not eof(X) do begin { copy a line while not eoln(X) do end begin Read(X,C); Write(Y,C) end; Readln(X); Writeln(Y) 

A note on implementation: A straightforward method of representing the end-of-line marker is by using control characters. For instance, in the ASCII character set the two characters, cr (carriage return) and If (line feed), conventionally are used to mark the end of a line. However, some computer systems use a character set devoid of such control characters; this implies that other methods for indicating the end of a line must be employed. 

