filenames from split command

Is there an option or a way with the split command to rename the partitioned files with a counter. For example, can the files testaa, testab, testac be renamed to test1, test2, test3 from the split command without explicilty renaming files.

Thanks,

  • CB

Try man csplit -

The csplit command writes the segments to files xx00 . . . xx99, depending on how many times the Argument parameter is specified (99 is the maximum).

I checked man on split - didn't have a similar option.

So let's say I have a file test.dat with four records and I want to split it into 2 partitions. What is the syntax of csplit in this case.

Thanks,

  • CB

Hi.

The GNU/Linux version of split allows numeric:

I did not see that the split in HP-UX B.11.00 or Solaris 10 had those options.

If one is ambitious, there is a perl version of split at html/commands/split/split.lafferty - metacpan.org which one could modify to do whatever one wants ... cheers, drl