Parsing cron with sed

Hello
I want to convert my cron list into a csv
Can you please help me with sed ?
eg:

Convert

#06,21,36,51 *  *  1,2  * (. ~/.profile ; timex /some/path/script -30 -15)       >>    /some/path/logfile2 2>&1
* * * * * (. ~/.profile ; timex /some/path/script2) >   /some/path/logfile2

To:

#;06,21,36,51;*;*;1,2;*;/some/path/script;-30 -15;/some/path/logfile;
;*;*;*;*;*;/some/path/script2;;/some/path/logfile2;

Thank you in advance

you lost the (. ~/.profile ; in your conversion ... and this line is important : you shouldn't ignore it

maybe try something like this

crontab -l | sed 's/;/";"/;s/\s\s*/ /g;s/\s/;/;s/\s/;/;s/\s/;/;s/\s/;/;s/\s/;/' >crontab.csv

1) The existing ; are protected by double quote ";"
2) collapse all blank character (space, tab) into one single space
3) replace only the 5 first space by a ; (the other one should not be replaced to respect the number of significant field of the crontab