🧩Extract Text Fragment

🧩 Extracting Text Fragment

The Extract Text Fragment tool lets you precisely trim parts of text based on position and length. This is ideal for cleaning up formatted data, isolating identifiers, or trimming fixed-position strings.


🎯 Use Case Examples

  • πŸ” Extracting the last 4 digits of a credit card number

  • πŸ›οΈ Isolating SKU codes from inventory lists

  • 🚚 Cropping tracking numbers or courier references

  • 🧾 Pulling coupon codes, order numbers, or line IDs

  • πŸ”’ Shortening hashes, wallet addresses, or UUIDs


βš™οΈ Main Controls

Here's a breakdown of the available input fields and their behavior:

🟣 Input Text

This is your source data. Paste in plain text, multi-line input, or structured text blocks.

🟣 Starting Position

Defines the character position where extraction begins.

  • Positive values start from the left (index 0 = first character)

  • Negative values count backward from the end of each string

Example: -4 grabs the last 4 characters

🟣 Fragment Length

Defines how many characters to extract.

  • Leave blank to extract everything from the start position to the end

  • Use - to extract from the beginning to the start position (exclusive)

Example: 2 start & 3 length = characters 2, 3, and 4 - length with start 5 will get characters before position 5

🟣 Line-by-Line Mode (Toggle)

When enabled, each line of your input is treated as a separate string to process individually.

  • Helpful when working with bulk lists like:

    12345678  
    98765432  
    66778899

    You’ll get one fragment per line.


πŸ“€ Output Section

The Text Fragment panel on the right displays the result of your extraction. You can copy or download the output using the clipboard and download buttons.


πŸ’‘ Pro Tips

πŸͺ› Empty Fragment Length = β€œgrab everything from starting point to end” πŸ” Use Line-by-Line with CSVs, lists, or dumped data πŸ“ Preview results carefully when using negative positions β€” they reverse direction βœ‚οΈ You can use this to strip prefixes, clip IDs, or extract embedded codes


πŸ§ͺ Sample Scenarios

Input
Start
Length
Line-by-line
Output

abc123XYZ

3

3

Off

123

abc123XYZ

-3

Off

XYZ

12345678\n87654321

1

4

On

2345, 7654

Order-008829\nOrder-001239

-6

6

On

008829, 001239

Last updated