Hello everybody

I'd like to reshape my data from wide to long format but as the name of my variables are

userid f9001 f9002 f90003 f320001 f320002 f320003 f360001 f360002 f9001_co f9002_co f90003_co f320001_co etc. age gender etc.

I thought it might be done with foreach and local but with those variable names I don't know how to handle it.
Can anybody help?
Thanks in advance