Usage: php csv2ini.php file.csv > file.ini Notes: before converting you have to create and/or adjust all the first descriptive row Spaces are not allowed ! probably you need to do something like: php csv2ini.php file.csv | grep -v "nused" > file.ini