Product names too long? Shorten them with a short-name rule

คู่มือนี้ยังไม่ได้แปล จึงแสดงเป็นภาษาอังกฤษ

To be found in search, sellers pack every keyword into the product title and add tags such as 【In stock】 or 【Free shipping】. Titles like that do not fit on the picking screen, and the voice takes too long to read them out.

SortingGo can give every product a short name from a rule as it imports. The full product name is kept; the short name is what the screen shows and the voice reads. The problem is not specific to one platform: Shopee Taiwan is the example here, and the method works in any custom import format.

Where the rule is set

Create or edit a format in "Custom Import Formats" and go to step 3, "Field mapping". Under the product name field is "Short name rule", with six choices:

  • None (use as-is): no short name.
  • First N characters: keeps the first N characters of the name.
  • Nth segment (split by space): splits the name at spaces and takes the Nth part.
  • Bracket content: removes (or keeps) the text inside brackets such as 【】, [ ] or 「」.
  • Custom regex: one regular expression that says which part to take. The most flexible.
  • Steps (applied in order): chains the actions above one after another, with no regex to write.

When the rule finds nothing (a name that is only tags, say), that product simply has no short name and its full name is shown as usual. Nothing fails.

Why the simple rules fall short

Take one typical product name and see what each rule makes of it:

ชื่อสินค้า:【24H出貨】保溫杯 不鏽鋼 大容量 辦公室 隨行杯 [免運]

กฎ ชื่อย่อที่ได้
First N characters (6) 【24H出貨 The start is a tag, not the product.
Nth segment (1st) 【24H出貨】保溫杯 No space between the tag and the name, so the tag stays attached.
Bracket content (remove 【】 and [ ]) 保溫杯 不鏽鋼 大容量 辦公室 隨行杯 The tags are gone, but it is still too long.
Steps: remove text in brackets → take a word 保溫杯 Two moves chained: the product itself.
Custom regex (the example template's rule) 保溫杯 The same result, written as one regex.

A usable short name takes two moves: drop the tags, then take a word. Each of the first four rules does only one. Two rules can chain the moves: Steps is the easiest to start with; Custom regex is the most flexible, and an AI assistant can write it for you. Both are covered below.

The easiest way: steps

Choose "Steps (applied in order)" as the short name rule. The app starts you with two steps: "Remove text in brackets" and "Take words" (one word, from the first). Steps run from top to bottom, each on the result of the one before; add, delete or reorder them with the arrows.

【24H出貨】保溫杯 不鏽鋼 大容量 辦公室 隨行杯 [免運] → 保溫杯

When a title starts with a promotional word outside brackets, the short name becomes that word:

加厚款 帆布袋 大容量 購物袋 【買二送一】 手提 肩背 → 加厚款

Add a "Remove listed words" step between the two and list the promotional words your shop uses, separated by commas:

加厚款 帆布袋 大容量 購物袋 【買二送一】 手提 肩背 → 帆布袋

If a promotional word ends up as the short name of several products, the app lists it under the warning with "Remove this word" next to it; one tap adds it to the list for you.

When different products share their first word, set "Take words" to take two:

【現貨】保溫杯 兒童款 吸管 卡通 背帶 [免運] → 保溫杯 兒童款

Worked example: the Shopee Taiwan template

This is the library's "Shopee Taiwan orders (to ship)" template with a short-name rule added. Download both the format file and the sample to your phone:

Shopee Taiwan orders (to ship, with short names)

  1. ใน SortingGo เปิด "1. นำเข้า" แตะเมนูรูปแบบการนำเข้า แล้วเลือก "เลือกจากคลังเทมเพลต…"
  2. ค้นหาแพลตฟอร์มของคุณ แล้วแตะ "เพิ่มและใช้นำเข้าครั้งนี้"
  3. เลือกไฟล์คำสั่งซื้อที่ส่งออกจากแพลตฟอร์ม หรือจะเลือกไฟล์เลยก็ได้ เมื่อแอปจำรายงานของแพลตฟอร์มได้ จะถามว่าต้องการใช้เทมเพลตที่ตรงกันหรือไม่

เพิ่มจากไฟล์ก็ได้: ดาวน์โหลดไฟล์รูปแบบของเทมเพลต (.xlsx) แล้วใน SortingGo เปิด "รูปแบบการนำเข้าที่กำหนดเอง" แตะ "นำเข้ารูปแบบ" และเลือกไฟล์นั้น

ต้องใช้ SortingGo 1.9.6 ขึ้นไป

ใช้เทมเพลตได้ทุกแพ็กเกจ รุ่นฟรีและ Lite จะไม่นำเข้าเลขคำสั่งซื้อและรหัสสินค้า ส่วนฟิลด์อื่นรวมถึงสเปกจะถูกนำเข้า

Its rule is written as one regular expression and does the same as the two steps above (checked row by row on a real order report: identical results):

^(?:【[^】]*】|\[[^\]]*\]|[\s\u3000])*([^\s\u3000【\[]+)
  • The first half, ^(?: … )*, means: from the start of the name, skip every 【…】, every […] and every space (full-width spaces included).
  • The ( … ) in the second half is the part to take: the characters that follow, up to the next space or bracket. What is inside these parentheses is what the app uses.

The sample holds two cases this rule handles badly, on purpose. After importing it you will see:

加厚款 帆布袋 大容量 購物袋 【買二送一】 手提 肩背 → 加厚款

The promotional word 加厚款 ("thicker") is not in brackets, so it is taken for the product.

【現貨】保溫杯 兒童款 吸管 卡通 背帶 [免運] → 保溫杯

This is a different tumbler, yet it gets the same short name as the first one. Two products with one name are easy to mix up on the floor.

On one real Shopee Taiwan order report (57 rows to ship, 30 products) this rule produced 24 different short names. Used as it is, then, some products share a name. Treat it as a starting point and adjust it for your shop.

Testing a rule in the app

When you edit a format, step 1 asks you to choose a sample file again (use your own order file, or the sample downloaded above). In step 3, once a rule is chosen, the app shows right under it, as you type:

  • "Preview with current sample data": "full name → short name" for the first few rows of the sample.
  • A summary: how many different product names the sample has and how many short names they become. If the two numbers differ, some products share a name.
  • A warning in orange, naming the shared short names, whenever products share one. With Steps, each shared name also has "Remove this word" next to it.
  • "Try a product name" (with Custom regex): paste any product name and see its short name at once. An invalid regex is reported here too.

The summary looks at up to the first 200 different product names in the sample. The preview in step 4 lists the short name each row will really get; look once more before saving.

Adjusting the rule with a regex

A regex can do everything the steps do and handle odder titles as well. The three variations below can be copied as they are into the Custom regex field; then replace the Chinese parts with your own.

1. Promotional words outside brackets at the start: add them to the "skip" list, separated by |. The example skips 加厚款 and 現貨. Write each word in full; one that is too short will also eat the start of a product name.

^(?:【[^】]*】|\[[^\]]*\]|[\s\u3000]|加厚款|現貨)*([^\s\u3000【\[]+)

加厚款 帆布袋 大容量 購物袋 【買二送一】 手提 肩背 → 帆布袋

2. Different products share their first word: take the first two words instead.

^(?:【[^】]*】|\[[^\]]*\]|[\s\u3000])*([^\s\u3000【\[]+[\s\u3000]+[^\s\u3000【\[]+)

【24H出貨】保溫杯 不鏽鋼 大容量 辦公室 隨行杯 [免運] → 保溫杯 不鏽鋼

【現貨】保溫杯 兒童款 吸管 卡通 背帶 [免運] → 保溫杯 兒童款

3. Tags in another kind of bracket: add that bracket too. The example also handles 「」.

^(?:【[^】]*】|\[[^\]]*\]|「[^」]*」|[\s\u3000])*([^\s\u3000【\[「]+)

「特價」蘋果 禮盒 12入 → 蘋果

In these expressions \s means ASCII whitespace only. Product names often mix in full-width spaces, so every pattern above also lists \u3000 (the full-width space). Keep it when you write your own.

Let an AI assistant write the regex

You do not need to know regular expressions. In step 3, choose Custom regex and tap "Copy AI prompt", then paste it into the AI assistant you use (ChatGPT, Gemini, Claude and so on). The prompt already states the app's rules and carries the current regex and up to 30 product names from your sample; the assistant replies with a regex and what each name becomes.

  1. Paste the regex from the reply into the Custom regex field.
  2. Read the summary and the warning below it. If products still share a name, or a short name is wrong, tell the assistant which product names and ask it to revise.
  3. The assistant can be wrong. What the app's test shows is what counts.

The prompt holds product names only: no orders, buyers or other columns. It reads as follows (the app fills in the last two parts for you):

ฉันใช้แอป SortingGo นำเข้าคำสั่งซื้อจากร้านค้าออนไลน์ ชื่อสินค้ายาวเกินไป จึงต้องการ regular expression หนึ่งรายการที่ดึงชื่อสั้น ๆ ซึ่งยังบอกได้ว่าเป็นสินค้าอะไร ออกมาจากชื่อสินค้าแต่ละรายการ

เงื่อนไข:
1. ใช้ไวยากรณ์ regular expression ที่เข้ากันได้กับ Java
2. แอปใช้เฉพาะผลการจับคู่ครั้งแรก และใช้เนื้อหาใน capture group ( ) แรกเป็นชื่อย่อ หากไม่มี capture group จะใช้ผลการจับคู่ทั้งหมด
3. \s จับคู่ได้เฉพาะช่องว่างแบบ ASCII ส่วนช่องว่างแบบเต็มความกว้าง (U+3000) ต้องระบุแยกต่างหาก
4. ชื่อย่อควรสั้น (ประมาณ 1 ถึง 3 คำ) และเป็นชื่อของตัวสินค้าเอง ไม่รวมป้ายโปรโมชันในวงเล็บ เช่น 【】 หรือ [ ] ชื่อร้าน และคำโปรโมชันอย่าง "พร้อมส่ง" หรือ "ส่งฟรี"
5. สินค้าที่ต่างกันควรได้ชื่อย่อที่ต่างกันให้มากที่สุด

โปรดตอบ regular expression ไว้ในบรรทัดแยกก่อน เพื่อให้คัดลอกได้ง่าย จากนั้นแสดงชื่อย่อที่ชื่อสินค้าแต่ละรายการด้านล่างจะได้ และระบุสินค้าที่ regular expression นี้จัดการไม่ได้

regular expression ปัจจุบัน: (ยังไม่ได้ตั้งค่า)

ชื่อสินค้า:
(วางชื่อสินค้าของคุณที่นี่ บรรทัดละหนึ่งชื่อ)

Products the rule cannot handle

One rule does not have to cover every product. Let the rule handle most of them and set the rest one by one in "Product short names" (the tag icon at the top right of the import screen):

  • A short name you set by hand takes priority over the rule.
  • The "Pending" tab lists products whose name is longer than the length you set and that have no short name yet.
  • A hand-set short name is matched by product code and product name together. If a product is renamed on the platform, set it again.

Also map the spec field when you import. Even when two products share a short name, the spec (colour, size, capacity) is still shown and helps tell them apart.

อัปเดตเมื่อ 2026-10-05

SortingGo ไม่ได้เป็นพันธมิตรหรือมีส่วนเกี่ยวข้องกับแพลตฟอร์มที่กล่าวถึงในหน้านี้ ชื่อแพลตฟอร์มเป็นของเจ้าของแต่ละราย และใช้เพื่อบอกว่าเทมเพลตอ่านไฟล์ใดเท่านั้น

← เทมเพลตทั้งหมด

ศูนย์ช่วยเหลือ AI

📖 ศูนย์ช่วยเหลือ ChatGPT Gemini