List slice and join
Slice every line of a list and join it back: keep fields or character ranges, negative indexes, custom join text and optional dropping of empty results — all local.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
One record per line; every line is sliced and joined again. CRLF / LF / CR are all recognised.
Sliced and joined
The range is half-open, row order is preserved, and everything runs locally.
Enter a list to see the sliced and joined result
What this tool does
- Keep only column 2 (phone numbers, order ids) from a comma separated list and drop the rest
- Slice fixed-width logs or reports by character position, keeping just the leading 8 characters
- Re-wrap one column with quotes or semicolons to build a SQL IN list or another CSV flavour
Example
Input
张三,13800000000,北京 李四,13900000000,上海
Output
13800000000 13900000000
After splitting on commas, start 1 and end 2 (exclusive) keep only column 2. Leave the end index empty to slice to the end of the line.
Frequently asked questions
How is the range defined?
Half-open: the start index is included and the end index is not, exactly like slice in most programming languages. Fields are zero based, so "start 1, end 2" keeps the second field only. An empty end index means "to the end of the line".
What do negative indexes mean?
They count back from the end of the line: -1 is the last field (or the last character) and -2 the one before it. A common combination is start -2 to keep the last two columns. Indexes outside the range are clamped to the start or the end instead of raising an error.
Fields mode versus characters mode?
Fields mode splits the line on the delimiter first and then takes the range, which suits CSV, TSV (put a tab or \t in the delimiter box) and other structured text. Characters mode ignores delimiters and slices by code point position, which suits fixed-width reports. Both work line by line and never match across line breaks.
What happens to blank lines and empty slices?
Blank lines are processed like any other line and usually come out blank. If a range selects nothing (for example the start index is past the last field of that line) the result for that line is empty; enable "Drop empty results" to remove such lines. The "Empty slices" statistic counts them.
Is the list uploaded?
No. Splitting and joining happen in your browser, the list or CSV never leaves your machine, and you can copy the result to save it.
Keywords:list slicesplit-joinoffline