Split a file by line and have control over resulting files extension
62
votes
3
answers
126755
views
There is a standard command for file splitting -
split
.
For example, if I want to split a words
file in several chunks of 10000 lines, I can use:
split -dl 10000 words wrd
It would generate several files of the form wrd.01
, wrd.02
and so on.
But I want to have a specific extension for those files - for example, I want to get wtd.01.txt
, wrd.02.txt
files.
Is there a way to do it?
Asked by Rogach
(6533 rep)
Feb 25, 2012, 04:47 AM
Last activity: Jul 26, 2023, 12:45 PM
Last activity: Jul 26, 2023, 12:45 PM