Hello everyone, was wondering if there's a way to add a page break in a text file, when certian string is found. I need to format pages in a text file. Any help is greatly appreciated. Thank you.
I did not think .txt files ever had formatting?
You might be able to use MS WORD to reformat your file.
Open the text file in MS WORD.
Press 'CTRL' & 'H' (Open Find & Replace)
Press 'ALT' & 'N' (Find What)
ENTER THE TEXT TO REPLACE WITH PAGE BREAK
Press 'ALT' & 'I' (Replace with What)
Press 'M' (to open more search options)
Press 'E' (Special Characters)
Press 'K' (Manual Page Break)
Press 'ALT' & 'A' (Make replacements)
Then save it as a DOC file.
Are you trying to force a page break when the text file is sent to a printer, or just when it is viewed? If the former, you will need to know what control character or escape sequence the printer is expecting for a page break. I think Ctrl-L is somewhat common, but that is just off the top of my head so you'll want to verify.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.