Advertisement
Guest User

Untitled

a guest
Dec 2nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. # The following will split a CSV (file.csv) into multiple parts of 1 million lines each
  2. # with each part having its own header.
  3. #
  4. # PREFIX denotes the filename to use for the parts. A number will be added to the end.
  5.  
  6. tail -n +2 file.csv |
  7. split -d -l 1000000 - --filter='sh -c "{ head -n1 file.csv; cat; } > $FILE"' PREFIX
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement