Re: getting rid of multiple consecutive blanks ?

John Markley <[email protected]> Mon, 26 Oct 2009 09:35:37 -0400
Newsgroups gmane.comp.handhelds.palm.peditors
Message-ID <[email protected]>
Quoting Voytek Eymont <[email protected]>:

>
> <quote who="John Markley">
>
> John, this runs perfect, BUT, what I really need, is replace two or more
> LF with a single LF
>
> so.....
> let's try:
>
>  {LFdelete::
>  /&runtimeInit[]
>  /xEpro f
>  /xEpro T/xEpro W/xEpro R/xEpro r
>>> /p10 /p10
>  /&script$[@@LFd2@@]}
>  {LFd2::
>  /&tap i[080,080]
>  /&script$[@@LFd3@@]}
>  {LFd3::
>>> /p10
>  /xEpro f  A
>  /&script$[@@LFd4@@]}
>  {WTC4:: d}
>
> --
> Voytek

Yes, that will work.  However, I made an error and left an incorrect  
designator at the very end. {WTC4:: d}   should be  {LFd4:: d} .  This  
new version will indeed replace two linefeeds with one.   
Unfortunately, if there are more than 2 LF in one blank space it will  
still only replace two of those with one, unlike the space-deleting  
pScript, which replaces two or more spaces with one.  So, with the LF  
you will need to run it more than once to get rid of multiple  
in-continuity linefeeds.  This is because we cannot make a RegExp f&r  
for linefeeds as we could for spaces, since a LF is a prohibited  
RegExp character.  I might be able to make the LF pScript  
self-repeating until all multiples have been reduced to one, but there  
would be some risk of an unintended endless reiteration loop.  Safer  
to just run the current script several times if needed.

   ~ 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
>
>
>
>
>
>




------------------------------------

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/