In perl:
my ($city,$cat,$subcat) = split /-/,$ID;
In Java, you could use a StringTokenizer:
import java.util.*;
/*do ID concatenation, etc...*/
StringTokenizer st = new StringTokenizer(ID,"-");
city = st.nextToken();
cat = st.nexttoken();
subcat = st.nextToken();
Tutorial here:
http://www.devdaily.com/java/edu/pj/...pj010006.shtml
HTH
Charlie
--
Don't Stand on your head - you'll get footprints in your hair
http://charlieharvey.org.uk
http://charlieharvey.com