Skip to content

Instantly share code, notes, and snippets.

@sposmen
Created March 2, 2022 17:44
Show Gist options
  • Save sposmen/e710a88a652d18dc13484042b98ecc3e to your computer and use it in GitHub Desktop.
Save sposmen/e710a88a652d18dc13484042b98ecc3e to your computer and use it in GitHub Desktop.
Large Excel to split CSV helpers
# Command to convert the large Excel to csv. this is based on gnumeric
# To install it in Mac could be through `brew install gnumeric`
ssconvert -O "sheet=SHEET_NAME" EXCEL_FILENAME.xlsx CSV_FILENAME.csv
# Command to split the large csv in chunks of lines through parallel command.
# This case is 30K lines each file and each file will be numbered based on the `{#}` addition in the filename
# To install parallel in MAC `brew install parallel`
cat CSV_FILENAME.csv | parallel --header : --pipe -N30000 'cat > CSV_FILENAME_{#}.csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment