#52013 - 07/08/15 07:51 PM
Need help to remove one line in Data Selection
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
My data selection is an entire paragraph. However if one line is found I need to delete that entire line, not the paragraph. The line is by itself and wouldn't need any adjustment. However from letter to letter the line moves.
I have a condition that searches for this line and it is true when need be. So how can I use the condition, or press talk to not print the one line.
|
Top
|
|
|
|
#52014 - 07/08/15 07:54 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
I know this will not work as is, but this is what I would like to do
if &Condition is true then
find text "Find Me"
Replace With " " %Or change style to white color font
endif()
|
Top
|
|
|
|
#52015 - 07/08/15 10:06 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
In your data selection, tick the Custom Data Selection Option. In the String To Display field, right-click and select Data Selection, then re-select your entire paragraph. Each line will be added individually to the data selection, which will now look something like:
=@(1,1,30) true
=@(2,1,30) true
=@(3,1,30) true
=@(4,1,30) true
You can then add a simple condition on each of these lines to control if you want to display them, like this:
=if(@(1,1,30)='Find Me','',@(1,1,30)) true
=if(@(2,1,30)='Find Me','',@(2,1,30)) true
=if(@(3,1,30)='Find Me','',@(3,1,30)) true
=if(@(4,1,30)='Find Me','',@(4,1,30)) true
If you want to check whether the line contains a specific string (as opposed to the example above where the conditions looks for a perfect match), you'd use:
=if(pos('Find Me',@(1,1,30))>0,'',@(1,1,30)) true
=if(pos('Find Me',@(2,1,30))>0,'',@(2,1,30)) true
=if(pos('Find Me',@(3,1,30))>0,'',@(3,1,30)) true
=if(pos('Find Me',@(4,1,30))>0,'',@(4,1,30)) true
So basically, the if() inline function is your friend! Check out the online PlanetPress Talk documentation for more information.
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#52026 - 07/09/15 11:17 AM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
The data selection is an entire letter. Data is a text file, but it is a letter format from a mainframe.
|
Top
|
|
|
|
#52030 - 07/09/15 01:55 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
Then you should create a user-defined emulation for it and filter out that line. The technique I posted would still work, mind you, but admitetdly, it would be a bit of an overkill.
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#52031 - 07/09/15 02:55 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
I do have a user defined emulation. Just not sure how to remove the line. Below is my code.
if(eq(left(&str,1),'1')) set(¤t.line,¤t.line + 1) store(¤t.line,right(&str,length(&str)-1)) elseif() set(¤t.line,¤t.line + 1) store(¤t.line,&str) endif()
if(eq(left(&str,1),'1')) doform() clearpage() endif()
|
Top
|
|
|
|
#52032 - 07/09/15 03:28 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
Try something like:
if(eq(left(&str,1),'1'))
set(¤t.line,¤t.line + 1)
store(¤t.line,right(&str,length(&str)-1))
elseif(pos(&str,'Find Me')>0)
set(¤t.line,¤t.line + 1)
store(¤t.line,'')
else()
set(¤t.line,¤t.line + 1)
store(¤t.line,&str)
endif()
if(eq(left(&str,1),'1'))
doform()
clearpage()
endif()
Note that you will have to adapt that code to suit your needs, I merely added an extra check inside the condition that stores an empty string in the data page if the string Find Me is found anywhere on the line. I didn't touch your check for character '1' because I don't know if it's related to this issue or not.
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#52033 - 07/09/15 04:27 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
The string 'Find Me' stills shows on my page.
|
Top
|
|
|
|
#52034 - 07/09/15 04:33 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
|
Did you implement the code exactly as I posted it? Or did you add that extra elseif() after you existing elseif() (which would therefore act as a catch-all case)?
_________________________
Technical Product Manager I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen
|
Top
|
|
|
|
#52035 - 07/09/15 07:15 PM
Re: Need help to remove one line in Data Selection
[Re: GBowlsby]
|
OL Expert
Registered: 08/07/14
Posts: 167
Loc: Tallahassee FL
|
I posted tried exactly as you posted
|
Top
|
|
|
|
|
|