Re: rearrange text

2005-03-03 Thread Russell Blau
"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

Re: rearrange text

2005-03-02 Thread Daniel Skinner
ah thanks I couldn't figure out how to join it up very appropriately, had this loop ... yeeeaah .. :) Thanks for both comments -- http://mail.python.org/mailman/listinfo/python-list

Re: rearrange text

2005-03-02 Thread Simon Brunning
On 2 Mar 2005 07:36:48 -0800, Daniel Skinner <[EMAIL PROTECTED]> wrote: > If I have the following text > > var = '1,2,3,4' > > and I want to use the comma as a field delimeter That bit's easy: C:\WINNT\system32>python Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32

Re: rearrange text

2005-03-02 Thread Roel Schroeven
Daniel Skinner wrote: > 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? I take it you want to swap the second and the third element? That can be acc