i used below command to spit the file
split -l 100 date.csv date.csv
The files are splittes as below
date.csvaa
date.csvab
date.csvac
date.csvad
date.csvae
I want to rename the files as below.
date_1.csv
date_2.csv
date_3.csv
date_4.csv
date_5.csv
please help
this line does it in one-shot:
little test (from stdin):
There are many ways of approaching this. Other answers provide a way to do it just with arguments passed to
split
- however the version of split on ubuntu 12.04 don't appear to support the arguments used in those answers.Here is one. This splits the files and uses the default option on
split
to prefix the file names with anx
. It then lists the files in order and renames them as required.