IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#41689 - 12/12/12 08:11 AM Removing (stripping) text from Data Selection
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Good Morning everyone,

Forgive the simplicity of this question as I am new to Planet Press and currently working through the documentation provided when I have available time.

I am looking for a way to remove specific text from a data selection and I believe I can use strip( to do this but I was not able to successfully do this.

An example of the text within this data selection is: Quality - N (No Credit)

I would like to strip the (No Credit) out of this data selection when it appears anywhere within the selection.

Thank you in advance,

Mike Weber

Top
#41690 - 12/12/12 08:30 AM Re: Removing (stripping) text from Data Selection [Re: Wildcard]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
You could do this using the 'strip' function.

In your data selection, click "Custom data selection" and type in the box:

Code:
=strip('(No Credit)',@(&current.line, 1, 100))

...where 1 and 100 are the columns between which your data lies on the 'current line'.

Hope this helps.

Top
#41693 - 12/12/12 09:21 AM Re: Removing (stripping) text from Data Selection [Re: jim3108]
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Thanks for the response Jim,

I tried this but I get the following Result.

Result: PTK0039: "current.line" does not seem to be an interger variable.

Top
#41694 - 12/12/12 09:23 AM Re: Removing (stripping) text from Data Selection [Re: Wildcard]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 4956
Loc: Objectif Lune Montreal
Wildcard,

Did you put the "&" sign before "current"? It has to be there, otherwise it will not recognise it as a variable.

Regards,
Raphaël Lalonde Lefebvre

Top
#41697 - 12/12/12 09:53 AM Re: Removing (stripping) text from Data Selection [Re: Raphael Lalonde Lefebvre]
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
No more errors thankfully but why wont the rest of my data show up?

I am not sure what I am missing. No more errors are present, but the data selection is blank. My data selection is from line 15 to line 58, column 43 to 60. The function I have in there is this.

Code:
=strip('(No Cr', @(&current.line, 43, 60))


None of my data shows up with this function in place. If I change the &current.line to the actual line number it is located on, the function displays that line with the (No Cr stripped from it as intended. But none of the other lines are visable anymore.

I tweaked it a little bit to fit my data selection and it has to strip out '(No Cr' instead of (No Credit) I assume that I will be able to create several more functions to strip out other chunks of text as well?



Code:
Quality (Sales Adj
Quality - A (Retur
Quality - B (Sp.Li
Quality - C (Salva
Quality - D (Short
Quality - E (Color
Mis-picks         
Shortages         
Sales Error       
Customer          
Entry Error       
Price Adjustment  
Miscellaneous     
Fuel Surcharge    
Pallet Cover      
Driver Error      
Product Recall    
Damaged           
FSTC Returns      
Quality - N (No Cr
 

Top
#41700 - 12/12/12 05:09 PM Re: Removing (stripping) text from Data Selection [Re: Wildcard]
Philippe F. Offline
OL Expert

Registered: 09/06/00
Posts: 1984
Loc: Objectif Lune, Montreal, Qc
You can't use &current.line on a data selection that contains multiple lines. As soon as you use an advanced expression, that expression operates on a single line.

Thankfully, there's an easy way to do this:

  • Create a data selection that contains only the first item, on line 15
  • Make sure you set it to custom data selection and use the strip command: =strip('(No Cr', @(&current.line, 43, 60))
  • Go to the Repeat tab of your data selection object and set the From/To line fields to 15 and 58

Here, the advanced data selection will get "repeated" for each line in the From/To settings, incrementing the &current.line value as it goes.

That should do the trick.
_________________________
Technical Product Manager
I don't want to achieve immortality through my work; I want to achieve immortality through not dying - Woody Allen

Top
#41713 - 12/13/12 09:35 AM Re: Removing (stripping) text from Data Selection [Re: Philippe F.]
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Thank you Philippe! It is working as intended now.

Is there a way to add multiple items to this strip function? I thought I would be able to do something like this to strip out additional selections as well.

This is what I tried to do but it does not like this.

Code:
=strip('(No Cr','(Sales Adj',@(&current.line, 43, 60)) 


I tried adding a new function but it displays the data twice with the first column removing the (No Cr and the second removing the (Sales Adj

The end result I am looking for is preventing the following items showing up.

(Sales Adj
(Retur
(Sp.Li
(Salva
(Short
(Color
(No Cr

Sorry again for all the easy questions.

Top
#41714 - 12/13/12 10:14 AM Re: Removing (stripping) text from Data Selection [Re: Wildcard]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
If you are trying to strip an already stripped string, you need two strip functions...

Code:
=strip('Ja',(strip('mes','James Stacey')))


This will return "Stacey" which is my surname stripping out my first name, "James".


Edited by jim3108 (12/13/12 10:16 AM)

Top
#41720 - 12/13/12 01:42 PM Re: Removing (stripping) text from Data Selection [Re: jim3108]
Wildcard Offline
OL Newbie

Registered: 08/30/12
Posts: 25
Thanks Jim! This has given me the desired result I wish to have.

Top
#41744 - 12/17/12 05:54 PM Re: Removing (stripping) text from Data Selection [Re: Wildcard]
jim3108 Offline
OL Expert

Registered: 04/19/10
Posts: 316
Loc: London, UK
No problem - glad I could be of assistance.

Top