trying to remove some spaces at the end of a line
- I have just started a clip. A little rough so far, but it isn't behaving
the way I want already....
I want to be able to take a .txt file with multiple lines, remove the spaces
from the right end of each line.
Take 4 lines of "input" and make it pipe delimited and carraige return then
I am using "x" instead of spaces at the end of the line because I can see
them working. On the first loop, it removes the x at the end, and on the
next it doesn't, even though I can see it selected...
Here is my text file for testing:
this is line 1x
this is line 2x
this is line 3
this is line 4x
this is line a
this is line bx
this is line c
this is line d
Here is my clip:
;this is a clip to take x lines of secondary file
;and render them in a pipe delimited file
;by Don Passenger dpasseng@...
^!If ^$GetSelection$ = "x" SPACE ELSE NOSPACE
^!INFO "got to after if"
^!INFO "got to space"
^!Replace "x" >> "" H
^!If %Counter% = "0" END ELSE REPEATAGAIN
^!INFO "no space"
Here is the output I want when I am done:
this is line 1|this is line 2|this is line 3|this is line 4
this is line a|this is line b|this is line cthis is line d
I haven't gotten to the pipe part yet obviously as I cannot remove the "x"
... and in the real file, I have spaces instead of "x" I am trying to
Personal Page: http://www.iserv.net/~dpasseng
Court Page: http://www.iserv.net/~dpasseng/grdc
- Hi Don,
>I am using "x" instead of spaces at the end of the line because IUse the "T" option:
>can see them working. On the first loop, it removes the x at the
>end, and on the next it doesn't, even though I can see it
>^!INFO "got to space"
>^!Replace "x" >> "" H
^!Replace "x" >> "" HT
I don't understand your Clip totally because you abort out of it if
no space (x) is found leaving the rest of the lines undone. See if
you can use part or all of the following. It assumes you want to do
the whole document and that there is a final return after the last
line of text.
^!Replace "^p" >> "|" S
^!If ^%n% = 4 Skip
Subscribe, UnSubscribe, Options