π§©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 start5
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
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