You are here:  » Unusual filter needed to assign category in feed

Support Forum



Unusual filter needed to assign category in feed

Submitted by teezone on Sat, 2008-08-09 19:01 in

Hi David, I've tried to figure this one out... for a new merchant feed, the precise category needed is the last word in the product description.

I have two fields to work with:

Field 1:
Nike Dunk Black High Top Sneakers
Diesel Viker 71J Jeans

Field 2, which converts the above:
Nike, Dunk, Black, High, Top, Sneakers
Diesel, Viker, 71J, Jeans

All I need to do is extract the last word from Field #2 - is there a way to define explode "last"..?

Thanks!
T.

Submitted by support on Sat, 2008-08-09 19:06

Hiya,

Yes - the version of the Explode filter in this thread:

http://www.pricetapestry.com/node/2017

...will take a negative value as the "Return Index" field, meaning that number of fields from the end of the exploded array rather than the start. So, if you use this new version (or add it if you don't already have the explode filter), you should be able to use "," as the explode character or string, and then -1 as the return index to return the last value...

Cheers,
David.

Submitted by teezone on Sat, 2008-08-09 19:15

You're a genius!!

Thanks for that..

..silly me for thinking this was a new "problem" :)

Submitted by jim on Mon, 2008-08-11 01:13

Hi David, I have a question along the same lines as this thread

I'd like to make a category out of the first word (or words in some instances) in a product description, which is the name of a band.. this always appears in CAPITAL LETTERS at the front of the product description. How could I use a filter to achieve this?

Thanks in advance!

Submitted by support on Mon, 2008-08-11 07:39

Hi Jim,

This is a little trickier because of the way the filters work on the actual value in the feed rather than a copy per field. The work-around is to register a blank field as the Category field, and then add a Text After filter first and copy in the value of the product name using the placeholders, for example %NAME% (if the product name field is called NAME).

Then, you could add the Explode filter as described above, and use a single space character as the Explode Character or String, and a Return Index of 0 - that should do the trick!

Cheers,
David.