-
-
Save ptux/2c8bc65d75d20096e509be7cdb2f9eed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FILENAME=guid.csv | |
| HDR=$(head -1 $FILENAME) | |
| split -l 1000 $FILENAME xyz | |
| n=1 | |
| for f in xyz* | |
| do | |
| if [ $n -gt 1 ]; then | |
| echo $HDR > Part${n}-$FILENAME | |
| fi | |
| cat $f >> Part${n}-$FILENAME | |
| rm $f | |
| ((n++)) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment