;
;usage $splitup(source,destination folder/file) * Do not add .txt!
;
alias Splitup {
if (!$isfile($1)) { return -1 } | ; invalid source file
if (($nofile($2)) && (!$isdir($v1))) { return -2 } | ; invalid destination folder
if (!$mkfn($nopath($2))) { return -3 } | ; invalid destination file
var %i = 1 | filter -cffr 1-5000 $+(",$1,") $+(",$nofile($2),$mkfn($nopath($2)),%i,.txt")
while ($filtered) {
inc %i | filter -cffr $+($calc(1 + %i * 5000),-,$calc(5000 + %i * 5000)) $+(",$1,") $+(",$nofile($2),$mkfn($nopath($2)),%i,.txt")
}
remove $+(",$nofile($2),$mkfn($nopath($2)),%i,.txt") | dec %i
return %i
}