You can use $/ :)
$ ls -l zzz -rw-rw-rw- 1 tux users 60892 Feb 12 15:54 zzz $ perl -CS -Mautodie -wE'$/=\3000;my$i="0000";while(<>){open my $fh, " +>:encoding(utf-8)", "zz".$i++;print $fh $_}' < zzz $ ls -l zz0* -rw-rw-rw- 1 tux users 3624 Feb 12 15:58 zz0000 -rw-rw-rw- 1 tux users 3681 Feb 12 15:58 zz0001 -rw-rw-rw- 1 tux users 3661 Feb 12 15:58 zz0002 -rw-rw-rw- 1 tux users 3655 Feb 12 15:58 zz0003 -rw-rw-rw- 1 tux users 3652 Feb 12 15:58 zz0004 -rw-rw-rw- 1 tux users 3634 Feb 12 15:58 zz0005 -rw-rw-rw- 1 tux users 3640 Feb 12 15:58 zz0006 -rw-rw-rw- 1 tux users 3646 Feb 12 15:58 zz0007 -rw-rw-rw- 1 tux users 3631 Feb 12 15:58 zz0008 -rw-rw-rw- 1 tux users 3631 Feb 12 15:58 zz0009 -rw-rw-rw- 1 tux users 3692 Feb 12 15:58 zz0010 -rw-rw-rw- 1 tux users 3659 Feb 12 15:58 zz0011 -rw-rw-rw- 1 tux users 3647 Feb 12 15:58 zz0012 -rw-rw-rw- 1 tux users 3648 Feb 12 15:58 zz0013 -rw-rw-rw- 1 tux users 3634 Feb 12 15:58 zz0014 -rw-rw-rw- 1 tux users 3643 Feb 12 15:58 zz0015 -rw-rw-rw- 1 tux users 2514 Feb 12 15:58 zz0016
In reply to Re: how to split a file.txt in multiple text files
by Tux
in thread how to split a file.txt in multiple text files
by saulnier
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |