Re: getting rid of multiple consecutive blanks ?
John Markley <[email protected]> Sun, 25 Oct 2009 22:50:10 -0400
| Newsgroups | gmane.comp.handhelds.palm.peditors |
|---|---|
| Message-ID | <[email protected]> |
Quoting John Markley <[email protected]>: > > Stop, hold off. There is some problem with the Web Text Cleaner > pScript I posted earlier that I don't fully understand yet. Do not > use it. OK, the problem, which I still don't fully understand, resides in having the two processes linked, *and* running them using the pedit "Script Memo" ESC & command, plus a conflict I had in my own setup. But they work fine separately, so here is what you can do. There are a bunch of ways to run pScripts with pToolSet, but I'm assuming that you are running only peditPro. So, do the following- 1) Put the two pScripts below in your pScriptPad (the pad carries the label #1, but in fact it is the only pScriptPad). If you are able it is best to copy from this email and paste into your pScriptPad rather than manually transcribing, to avoid errors. 2) Open a spacey web page text in pedit. 3) Open menu, select R1, select "Script Memo" (or just do "ESC &"). 4) Type "LFd" (without the "") into the dialog box, then type ":" (without the "") or tap the D:, and the pScript will run. (this assumes you have no other pScripts whose identifier name starts with "LFd". The pScript opens the pedit find'n'replace (ESC f), sets it to start at the top, wrap, and unchecks RegExp, puts a LineFeed in the find field, and puts a single space in the replace field and then hits the Find/Repl button, then AllR, then Done. This will remove all linefeeds. 5) Open menu, select R1, select "Script Memo" again. 6) Type "SPd" (without the "") into the dialog box, then type ":" (without the "") or tap the D:, and the pScript will run. (this assumes you have no other pScripts whose identifier name starts with "SPd". The opens find'n'replace, checks RegExp on, puts " *" in the find field and a single space " " (/xs/xs*) in the replace field, and runs the All Replace. This will replace all multiple spaces with single spaces. The final result after both pScripts should be a clean, compact, non-spacey text. If you don't want to use the pScripts you can of course do these f&r's manually. Make sure beforehand that you do not have the * character selected as your pedit ESC character as that would confuse the RegExp implementation of " *". {LFdelete:: /&runtimeInit[] /xEpro f /xEpro T/xEpro W/xEpro R/xEpro r /p10 /&script$[@@LFd2@@]} {LFd2:: /&tap i[080,080] /&script$[@@LFd3@@]} {LFd3:: /p32 /xEpro f A /&script$[@@LFd4@@]} {WTC4:: d} {SPdelete:: /&runtimeInit[] /xEpro f /xEpro T/xEpro W/xEpro R /xs/xs * /&script$[@@SPd2@@]} {SPd2:: /&tap i[080,080] /&script$[@@SPd3@@]} {SPd3:: /p32 /xEpro f A /&script$[@@SPd4@@]} {SPd4:: d} Eventually I'll figure out how to link these together to run as one without the problems I was seeing, but not tonight. Addendum - just received your recent post. See how these two do. If we have to change to deal with tabs we will. ~ John ------------------------------------ Latest pedit/pToolSet/LapTopHack at http://www.osuweb.net/~pc/pca/pc_all.zip pedit/pToolSet/LapTopHack scripting info/resources at http://www.peditors.com Peditors Forum http://groups.yahoo.com/group/peditors Unsubscribe by writing to peditors-unsubscribe-hHKSG33Tihh4sT85+ipIM4ckdKdSAMto@public.gmane.org! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/peditors/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/peditors/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/