Support » Plugin: Category Import Reloaded » Format import text from spreadsheet

  • Eric3D

    (@eric3d)


    Great plugin.

    I had to import a few hundred categories and it worked great. To ease the formatting, I wrote a small script for Google Sheets (it probably also works in Excel). It might be handy for other users. This only handles the non-alphanumeric characters I had to deal with in this project and may need to be adjusted to suit your exact needs.

    Columns ABC contain the 3 levels of categories. Column D contains the code below. The value of column D can be copied into Category Import Reloaded.

    =regexreplace(A2, "/", "&.#047;")&"$"&regexreplace(regexreplace(LOWER(A2), " |\.|\,|/|&", "-"), "---|--", "-")&IF(B2<>""," / "&regexreplace(B2, "/", "&#.047;")&"$"&regexreplace(regexreplace(LOWER(B2), " |\.|\,|/|&", "-"), "---|--", "-"),"")&IF(C2<>""," / "&regexreplace(C2, "/", "&#.047;")&"$"&regexreplace(regexreplace(LOWER(C2), " |\.|\,|/|&", "-"), "---|--", "-"),"")

    What it does:
    1. Replace slashes in label with html entity
    2. Sanitizes the slug
    a. replace space, period, comma, slash, ampersand with hyphen.
    b. replace multiple hyphens with single hyphen.
    3. Combines everything in a single string

    • This topic was modified 2 months ago by .
Viewing 2 replies - 1 through 2 (of 2 total)
  • Eric3D

    (@eric3d)

    Note: remove period from &#.047; I had to add it to prevent it being displayed as a / slash.

    • This reply was modified 2 months ago by .
    Plugin Author nir0ma

    (@nir0ma)

    Hi @eric3d,
    Thank you for your investment.
    I might add this for the next release adn will also try to fix your other issue.
    Have a nice day and thank you for the feedback !

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.