Count the number of characters and words in your data

Count the number of characters and words in your feed data in Productsup.

In some cases, you may wish to count the number of characters or words in your data. Based on these characters or word counts, you may also wish to remove certain characters in order to keep the length to a certain limit.

Count words

You can count the number of words in a field by using the word count box. This will return the number of words in the data.

  1. Add the Word count box

Cut the last words from your data

You can cut the last words from data by using the cut last words box. This may be useful if you have a certain limit for an export field - for example, you are only allowed a max of 70 characters for the title.

  1. Add the cut last words box

  2. Define a character limit

  3. Any full words over this character limit will be cut

cut_last_words.png

Characters

Counting characters

You can count the number of characters in a field by using the character count box. This will return the number of characters in the data.

  1. Add the character count box

Cut the last characters from your data

You can cut the last words from data by using the cut last characters box. This may be useful if you have a certain limit for an export field - for example, you are only allowed a max of 70 characters for the title. This box carries out a hard cut at the limit you provide. This means that words can be cut in half.

  1. Add the cut last characters box

  2. Define a character limit

  3. Any characters over this character limit will be cut

Note

If you add a positive character limit (i.e. 100), the last characters above this limit will be cut.

If you add a negative character limit (i.e. -100), everything except the last characters will be cut.

cut_last_characters.png

Cut the first characters from your data

The cut first characters box works in a similar way to the cut last characters box but removes the first characters from your data.

  1. Add the cut first characters box

  2. Define a character limit

  3. Any characters up to this character limit will be cut

cut_first_characters.png

Trim data to Google’s max character limit

Google requires that the title attribute is shorter than 150 characters and that the brand attribute is less than 70.

To ensure your title meets the specifications set by Google, you can use the trim to 150 characters box. This cuts any characters over this 150 limit.

  1. Add the trim to 150 characters box

To ensure your brand meets the specifications set by Google, you can use the trim to 70 characters box. This cuts any characters over this 70 limit.

  1. Add the trim to 70 characters box

Trim the last category paths

If your category path is too long and you wish to remove the last categories above a certain character limit, then you can use the trim category tree box. This cuts the last categories by the delimiter “>” if the length exceeds the inputted limit.

  1. Add the trim category tree box

  2. Define a character limit for which the categories should be cut

trimming_category.png

If you want to trim after the 50th character, for example, your results would look like this -

input: Housewares > Linens & Bedding > Bedding > Bed Sheets output: Housewares > Linens & Bedding > Bedding