2021年1月19日星期二

How to split a file (over certain amount) without breaking lines (data being split of a record)

I am trying to develop a shell script with the requirement:

  1. Find files in a directory with size over 250 MB - how to discover the file?
  2. If it finds a file over 250 MB, split it to make it into smaller chunks without having data (records) being split apart.

Example - the script should be able to find a file that is 600 MB - I can expect to see 3 files (one that is 250 MB, 250 MB, and 100 MB). It should not exceed 250 MB per file and record should not be broken, the full record should be in the same file.

Any help would be appreciated!

Thank you

https://stackoverflow.com/questions/65800932/how-to-split-a-file-over-certain-amount-without-breaking-lines-data-being-spl January 20, 2021 at 07:16AM

没有评论:

发表评论