-1

Github restricts file uploads to 100mb. This is unfortunate for public data. I know I can split binary files with dd. What I would like to do is split them all into 99MB files but here's the catch, I don't want to split on a line -- only a newline. Is there an easy way to split up files into chunks based on their size, but not to mid-line.

Example

#/bin/sh
for i in $(seq 1 1000000); do
  echo "This is a test sentence." >> file
done;

Now file is 26MB. I would like that file to be split into 1 MB chunks, but never split anywhere but only a line-boundary (\n).

Evan Carroll
  • 30,763
  • 48
  • 183
  • 315

1 Answers1

-1

I missed this in the docs, so in the event this helps anyone else

-C, --line-bytes=SIZE put at most SIZE bytes of records per output file

Just ignore -n, --number=CHUNKS I didn't have to use that anyway.

Evan Carroll
  • 30,763
  • 48
  • 183
  • 315