Skip to content

Instantly share code, notes, and snippets.

@rasjonell rasjonell/xlsx_to_csv.sh
Last active Feb 26, 2020

Embed
What would you like to do?
Convert all .xslx files in a directory into .csv files and save them in `./csvs`
COUNTER=1
ls *.xlsx | sort -V | while read FILE
do
echo "CONVERTING ${FILE} into ${COUNTER}.csv..."
in2csv $FILE > csvs/"${COUNTER}.csv"
let "COUNTER++"
done
echo "You are all set!"
@rasjonell

This comment has been minimized.

Copy link
Owner Author

rasjonell commented Feb 26, 2020

you need to have csvkit. To install run sudo pip3 install csvkit

@rasjonell

This comment has been minimized.

Copy link
Owner Author

rasjonell commented Feb 26, 2020

there is probably a bug in csvkit that turns 1's into True :') so you might need to double-check your csvs before doing anyhting with them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.