![]() | |
#11
| |||
| |||
|
|
for John Weinshel, I know he lurks here now and then, and he is active on some more developer-oriented other lists. |
|
What part of the world are you in (feel free to back-channel me if you'd like)? |
#12
| |||
| |||
|
#13
| |||
| |||
|
#14
| |||
| |||
|
|
You wrote: > This is a bug,imo. FM3/4/5/6 did it correctly. But I found: From the HelpFile of FM6 I copied the following. Returns the supplied text, stripped of all leading and trailing spaces. Tip Use Trim to remove unneeded spaces when you convert files from other programs or systems that require a fixed number of characters per field, or to remove spaces accidentally typed during data entry. This supports what I seem to remember. Trim has never done anything else then removing spaces. Ursus You are correct about the Trim, it is only for leading and trailing spaces. |
#15
| |||
| |||
|
|
You are correct about the Trim, it is only for leading and trailing spaces. In order to deal with multiple returns, you have to use a multiple Substitute and the "¶" (paragraph symbol, AKA as the PILCROW), such as shown in this formula posted by Bob Weaver on Oct 23, 2003, here: http://www.fmforums.com/threads/show...6&Number=85271 which I'm quoting here: Substitute(Substitute(Substitute(Substitute(InputT ext, "¶¶¶¶¶¶¶","¶"), "¶¶¶","¶"), "¶¶","¶"), "¶¶","¶") This formula will convert from 2 to 41 contiguous ¶'s to a single ¶. |
#16
| |||
| |||
|
|
Lee For FM7 this can be simplified into Substitute(Inputtekst; ["¶¶¶¶¶¶¶","¶"]; ["¶¶¶¶¶¶","¶"]; ["¶¶¶¶¶","¶"]; ["¶¶¶¶","¶"]; ["¶¶¶","¶"]; ["¶¶","¶"]) Ursus You are correct about the Trim, it is only for leading and trailing spaces. In order to deal with multiple returns, you have to use a multiple Substitute and the "¶" (paragraph symbol, AKA as the PILCROW), such as shown in this formula posted by Bob Weaver on Oct 23, 2003, here: http://www.fmforums.com/threads/show...6&Number=85271 which I'm quoting here: Substitute(Substitute(Substitute(Substitute(InputT ext, "¶¶¶¶¶¶¶","¶"), "¶¶¶","¶"), "¶¶","¶"), "¶¶","¶") This formula will convert from 2 to 41 contiguous ¶'s to a single ¶. |
#17
| |||
| |||
|
|
On Mon, 11 Jul 2005 00:46:33 +0200, ursus.kirk wrote: Lee For FM7 this can be simplified into Substitute(Inputtekst; ["¶¶¶¶¶¶¶","¶"]; ["¶¶¶¶¶¶","¶"]; ["¶¶¶¶¶","¶"]; ["¶¶¶¶","¶"]; ["¶¶¶","¶"]; ["¶¶","¶"]) You could do it recursively. Apart from that, you might just use Substitute(Inputtekst; ["¶¶","¶"]; ["¶¶","¶"]; ["¶¶","¶"]; ["¶¶","¶"]; ["¶¶","¶"]; ["¶¶","¶"]) This would remove up to 64 <CR> together, since every command would operate on two behind each other - and the next two behind each other, dividing the number of returns by two with every command. However, I'd prefer s( text, \r+, \r) - this would be a regular expressions syntax: s/\r+/\r/g Even simpler could be a supertrim function to cut off trailing and leading " ", hard space cmd-" ", optional "_", tab and cr... |

![]() |
| Thread Tools | |
| Display Modes | |
| |