Overview
Introduction
Once you have a list of paired entries, like "key:value" lines, you sometimes need to pull them back apart into two independent lists for separate processing.
List Unzipper reverses List Zipper's pairing, splitting each paired item back into its two original components.
What Is List Unzipper?
A list-splitting tool: it takes a single list of paired items and, for each one, splits it on a configurable glue string into a left part and a right part.
The two parts are collected into two separate output lists, List A (the left half of every pair) and List B (the right half).
How List Unzipper Works
The input is split into items using the selected separator, then each item is searched for the first occurrence of the glue string.
Everything before that first occurrence becomes the item's List A value; everything after becomes its List B value, and each collected list is rejoined using the shared separator.
When To Use List Unzipper
Use it to pull apart a list of "key:value" style entries back into separate keys and values lists.
It's the natural cleanup step after receiving paired data that a downstream tool needs as two independent lists instead.
Often used alongside List Zipper, List Comparer and List Item Replacer.
Features
Advantages
- Correctly reverses List Zipper's pairing even when one side's value itself contains the glue string, by only splitting on the first occurrence.
- Gives a clear, specific error identifying exactly which item and position failed to split, rather than a generic failure.
Limitations
- Every item in the input must contain the glue string at least once; items without it cause an error rather than being silently skipped.
- If a pair's intended left-hand value itself contains the glue string, unzipping will split at the wrong point since only the very first occurrence is used.
Examples
Best Practices & Notes
Best Practices
- Use the exact same glue string you used with List Zipper when reversing a previously zipped list.
- Pick a glue string that's unlikely to appear inside your data's actual values, to avoid ambiguous splits.
Developer Notes
Locates the split point with `item.indexOf(glue)`, using `.slice(0, glueIndex)` for the List A value and `.slice(glueIndex + glue.length)` for the List B value, which correctly handles glue strings longer than one character and preserves any later occurrences of the glue within the List B portion.
List Unzipper Use Cases
- Splitting a pasted list of "key:value" entries back into separate key and value lists
- Reversing a previous List Zipper operation to work with the two lists independently again
- Extracting two related columns of data from a single combined paired-item export
Common Mistakes
- Using a different glue string than the one originally used to zip the list, causing every item to fail with a "does not contain the glue" error.
- Expecting every occurrence of the glue string within an item to matter; only the first occurrence determines the split point.
Tips
- If several items report a missing-glue error, double-check that your paired items and glue string setting actually match.
- Chain each output list into another list tool, like Common List Item Finder, for further independent analysis.