pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

split Split on delimiter and rejoin with another

Aa Text
Input0 chars
Output0 chars

Flags

--on string default: ,
--join string default: \n

Examples

Split a comma-separated list into lines

Usage
"red,green,blue,yellow" | split

Split a semicolon-separated email list into one per line

Convert a tab-separated header row into readable lines

Usage
"Name	Email	Department	Start Date" | split --on=\t
View source
(input, opts = {})=>{
                const resolve = (s)=>s.replace(/\\n/g, "\n").replace(/\\t/g, "\t");
                const on = resolve(opts.on || ",");
                const join = resolve(opts.join ?? "\\n");
                return input.split(on).join(join);
            }