Skip to main content
2 of 5
Fixed formatting and units (gb should be GB), with code formatted as code
Chris Davies
  • 128.1k
  • 16
  • 178
  • 323

Combining .txt files but limiting the combined file into sized chunks

I have a batch of .txt files I want to combine so I can import into another program. This program is limited by 2GB data packets at a time but the total of the files will be 20GB.

Is it possible to combine the .txt files, limiting to 2GB each time, giving a total of 10x 2GB combined files? I'd like to add it to a script.

I am using the cat *.txt > (file) name and then split -b 2000m at the moment via commands, manually.

AJOS
  • 3
  • 2