I would like to split a huge text file into separate text files. I use:
split -l 1000 file.txt split_file
and I will get split_fileaa
, split_filebb
, etc.
How can I change the extension to be
split_file0.txt, split_file1.txt, etc
?
There is a -d
option for numeric suffixes.
--additional-suffix
is what you need for the additional suffix :
split -l 1000 -d --additional-suffix=.txt file.txt split_file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With