"Daniel Skinner" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I have the following text
>
> var = '1,2,3,4'
>
> and I want to use the comma as a field delimeter and rearrange the
> fields to read
>
> '1,3,2,4'
>
> How would I accomplish this in python?

Well, it kind of depends on how you want to do the rearranging, whether the
data in the fields is always going to be numbers or could be some other kind
of object, etc.

In general, though, what you seem to be looking for is:

mylist = var.split(',')
rearrange(mylist)
newvar = ','.join(mylist)


-- 
I don't actually read my hotmail account, but you can replace hotmail with
excite if you really want to reach me.



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to