Getting rid of line-breaks
George T. Greenfield (154) 748 posts |
I’m almost ashamed I need to ask this, bearing in mind I’ve been using RISC OS for thirty years. I’m using the !Sleuth OCR app to process scanned text, which works well on reasonable-quality greyscale sprites. When dropped into a text editor (I’m using !Edit) however, the line-breaks are still in the text, and I cannot see a way to get rid of them except by laboriously hand-editing each [0d] symbol out. I’ve looked in Edit-Find’s wildcard options in vain. There must be an easy way to do this and I’m sure someone out there knows it! |
Stephen Unwin (1516) 154 posts |
I’ve just had a look at this on RPi with !Edit version 1.69. hello Then using menu Edit>Find>Find text window There is an option on here for Magic characters. Try \x0D in the find box and either nothing or space in the replace box. Click Go and another window pops up with text found and some options. Replace will do one at a time, End of file replace should do them all. |
Rick Murray (539) 13840 posts |
Search (F4) for “ Edit: just noticed Stephen’s reply as I was writing mine. ;-) |
George T. Greenfield (154) 748 posts |
Worked like a charm: thanks to Rick and Stephen! One of the abiding joys of the RISC OS community (as exemplified here) is the prompt and knowledgeable help that is invariably offered to those in need of it, IME. |
David Gee (1833) 268 posts |
Just bear in mind that if paragraph breaks are indicated by two successive return characters, and you want to keep them, you will need to replace instances of such by something else first before you replace returns with spaces. |
Chris Dewhurst (1709) 167 posts |
In case it’s of any use George (or to anyone) if you need to join certain lines of OCRd text but not others (I was !Sleuthing some programming books so needed to wrap the text but not program lines) I found a quick way in Edit is to set the line length to some really large number like 10000 (Menu > Edit > Format Text > Format width = 10000) and repeatedly press Ctrl+F6 for each paragraph that needed to be wrapped and scroll down past ones that didn’t. |
Chris Evans (457) 1614 posts |
Chris D: The standard quicker way is with magic characters enabled search for: |
Steve Pampling (1551) 8170 posts |
I’ve always worked with a replace with “SGPreplace” for the ‘protected’ items – a handy combination other people tend not to have in the text being worked on. Others have included “MoetCat” (much lamented garden lion) |