Easiest way is to split each string into an array; most languages have a split() function that splits a string on a given delimiter.
String[] nameArray = nameList.split(",");
String[] numberArray = numberList.split(",");
Now you have two arrays, where numberArray[247]
contains the number that goes with the name in nameArray[247]
(for example).
So you could, for example, loop through them:
for (int i=0; i<nameArray.length; i++) {
println(nameArray[i] + " : " + numberArray[i];
}
It may be different depending on what language you're using, of course. The above examples are java-ish; in ruby the equivalent could be something like
Hash[*nameArray.zip(numberArray).flatten].each {|key, value| puts "#{key} : #{value}" }
EDITED TO ADD:
Here's an example using a space delimiter, and doing it in Python (disclaimer: I don't know Python particularly):
names = "John Paul George Ringo"
numbers = "11 12 13 14"
nameArray = names.split(" ")
numberArray = numbers.split(" ")
for i in range(len(nameArray)):
print nameArray[i] + ": " + numberArray[i]