進階文字分割器

分隔符選項

用於將文字分成部分的字元。(預設為空格)

用於分割文字的正則表達式。(預設為多個空格)

每個輸出區塊中的符號數量。

輸出中的等長區塊數量。

輸出分隔符選項

分割區塊之間的字元。(預設為換行)

附加選項:

如何使用進階文字分割器

  1. 貼上你的文字
    • 將您想要分隔的文字貼上或寫在工具頂部的大文字欄中。對於較長的文本,您也可以使用工具列中的「選擇檔案」選項匯入 .txt 檔案。
    • 要測試,使用「範例」按鈕來載入範例文字。這能幫助你在使用自己的資料之前了解不同分割方法是如何運作的。
  2. 設定拆分方法
    • 使用符號拆分: 選擇此項可以在每次出現特定字符時斷開文本,例如逗號、空格或分號。預設是空格,會將文本分隔成單詞。
    • 按正則表達式分割: 使用正則表達式進行詳細的拆分規則。默認 [^\a-zA-Z]+ 是一種在任意非字母字符序列上進行分割的方法。即使單詞中包含混合標點符號,它也會進行分割。
    • 長度拆分: 這種方法將您的文字拆分成固定字數的片段。輸入您要生成的數字(例如,100)以獲得相等部分,非常適合有字數限制的社交媒體帖子或簡訊。
    • 按區塊數拆分: 選擇文本應該被分成的相等段落數。工具會根據這個自動計算每個段落應該有多長。
  3. 自訂輸出及其他選項
    • 設定 輸出分隔符 控制分割的部分如何在結果框中被串接。換行(\n) 將每個段落放在自己的行上。一個管道 (|) 或逗號會形成一個有分隔符號的一行列表。
    • 使用這個 區塊前的字元區塊後的字元 欄位可以在每個被分割的部分前後加上前綴或後綴,例如引號或括號。
    • 探索 額外選項「保留分隔符」會在結果中保留分隔符字符,「對各部分編號」會給每個分割段添加連續編號,「忽略空部分」會刪除空的項目,而「去除每行的空格」會移除每行開頭和結尾的空格。
  4. 運行並匯出
    • 點擊 分割文字 分割你的輸入。結果將會立即顯示在下方的文字區域。
    • 點擊 複製結果 將輸出內容複製到你的剪貼簿或 下載 將其下載為 txt 文件。這 「清除全部」 按鈕會重置整個工具,準備好進行新的任務。

實用範例與使用案例

範例 1:處理逗號分隔清單(CSV 資料)

Let’s say you have some survey data or a basic CSV file that is not properly formatted. You want to put the individual things into a nice vertical list for study, or to import into another application.

apple, banana, cherry, date, elderberry, fig

配置: Choose 依符號分割 and type a comma (,) into the symbol box. Set the 輸出分隔符 to newline (\n). Get clean results by selecting 修剪空格 and 跳過空白部分.

This method is great for data cleansing, building lists for databases or preparing tags for a website CMS from one string of text.

輸出: All stray spaces removed, and every fruit is on its own line. The output is an organized list, ready to be used further.

apple
banana
cherry
date
elderberry
fig

範例 2:為簡訊或社交媒體貼文格式化文字

If you’re using a platform like Twitter (X) or SMS, there are quite severe character constraints. If you have a long message, you need to break it up into compliant portions and keep it readable.

Thank you for being part of the yearly tech conference. The talk on AI ethics was especially informative, stressing the importance of transparent algorithms. We are looking forward to seeing you at the workshop tomorrow.

配置: Select 按長度分割 and set 160 (a common SMS limit). The program will break the text into parts of exactly 160 characters. You may also add things like "(1/3)" to each bit with the "Char Before/After Chunk".

輸出: The text is now split into chunks within the character limit. This ensures that your complete message is sent and not cut off by the platform.

Thank you for being part of the yearly tech conference. The talk on AI ethics was especially informative, stressing the importance of transparent algorithms. We are looking forward to seeing you at the workshop tomorrow.