too many files. how to solve

I'm on a MacBookPro with M1Max.


I have a large text file with over 10 Million transactions.

That's too large to insert into the database at once, so I decided to split.


I did `split -d -l5000 transaction.csv trans.` and it runs without problems on linux, where it created exactly 2000 files. I also tried to split into smaller files and the result was having much more files, without problems.


When running the same command on MacOS Monterey, it returns the error `split: too many files`


I tried with `ulimit -n 6000` but still doesn't run.

Any help will be appreciated

MacBook Pro 16″, macOS 12.3

Posted on May 16, 2022 9:04 AM

Reply
Question marked as Top-ranking reply

Posted on May 16, 2022 10:14 AM

Solved adding -a 3 to the split command defining the length of the suffix ....


split -d -l5000 -a 5 transaction.csv trans.

Similar questions

4 replies

May 16, 2022 9:56 AM in response to paolodipietro

abarone wrote:

I'm on a MacBookPro with M1Max.

I have a large text file with over 10 Million transactions.
That's too large to insert into the database at once, so I decided to split.

I did `split -d -l5000 transaction.csv trans.` and it runs without problems on linux, where it created exactly 2000 files. I also tried to split into smaller files and the result was having much more files, without problems.

When running the same command on MacOS Monterey, it returns the error `split: too many files`

I tried with `ulimit -n 6000` but still doesn't run.
Any help will be appreciated


See if there is anything from the man page:

 man split | more


look at the examples for various options...




Terminal User Guide for Mac - Apple Support


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

too many files. how to solve

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.