in reply to Re^3: how to split a file.txt in multiple text files
in thread how to split a file.txt in multiple text files
If I invoke the script in this way: perl -CS split2.pl <input.txtuse strict; use warnings; use autodie; $/=\3000; my$i="000"; while(<>){open my $fh, ">:encoding(utf-8)", "input".$i++.".txt"; print $fh $_; close $fh;}
and only the first fragment is created "input000.txt"utf8 "\xE1" does not map to Unicode at split2.pl line 11, <> chunk 2. Close with partial character at (eval 21) line 67, <> chunk 2.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: how to split a file.txt in multiple text files
by choroba (Cardinal) on Feb 14, 2019 at 21:52 UTC | |
|
Re^5: how to split a file.txt in multiple text files
by saulnier (Initiate) on Feb 15, 2019 at 07:34 UTC | |
by Tux (Canon) on Feb 15, 2019 at 09:51 UTC | |
by saulnier (Initiate) on Feb 15, 2019 at 16:37 UTC | |
by Tux (Canon) on Feb 15, 2019 at 19:17 UTC | |
by saulnier (Initiate) on Feb 15, 2019 at 21:53 UTC |