Convert .csv file to .ods using terminal

I used the LibreOffice commandline to convert a sample csv file:

soffice --convert-to ods koko.csv --headless

So to use it in a batch command would be

for i in "$1"/*; do soffice --convert-to ods "$i" --headless; done

Usage: ./converter.sh /path/to/folder