Splitting two numbers joined by a minus sign

2007-11-08 Thread Demian
Hello, I ran into a problematic file that combined two numeric columns into one: ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 10.00 C ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 10.00 C ATOM327 CA GLU B 42 -27.716 76.690-295.429 1.

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Paul Lalli
On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 10.00

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rodrick Brown
On Nov 8, 2007 3:32 PM, Demian <[EMAIL PROTECTED]> wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 1

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread John W . Krahn
On Thursday 08 November 2007 17:48, Paul Lalli wrote: > On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > > > > I ran into a problematic file that combined two numeric columns > > into one: > > > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > > 10.00 C > > ATOM3

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rob Dixon
Demian wrote: I ran into a problematic file that combined two numeric columns into one: ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 10.00 C ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 10.00 C ATOM327 CA GLU B 42 -27.716 76.690-29

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread Rob Dixon
Paul Lalli wrote: On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: Hello, I ran into a problematic file that combined two numeric columns into one: ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 10.00 C ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 1

Re: Splitting two numbers joined by a minus sign

2007-11-08 Thread kens
On Nov 8, 3:32 pm, [EMAIL PROTECTED] (Demian) wrote: > Hello, > > I ran into a problematic file that combined two numeric columns into > one: > > ATOM325 CA GLU B 40 -30.254 72.432-297.620 1.00 > 10.00 C > ATOM326 CA ASP B 41 -28.149 73.031-294.529 1.00 > 10.00

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread Paul Lalli
On Nov 9, 2:09 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > Why have you decided that the OP's solution doesn't provide what he wants, > snipped it, and offered some code that does something very different? > and he asked for a more elegant way of doing the same thing. I would have > thought it wa

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread michael wang
if the minus sign always there, then use s/// seems faster than split, like while(){ s/(\d)-/$1\t-/; print "$_"; } On 11/9/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > On Nov 9, 2:09 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > Why have you decided that the OP's solution doesn't p

Re: Splitting two numbers joined by a minus sign

2007-11-09 Thread Rob Dixon
michael wang wrote: if the minus sign always there, then use s/// seems faster than split, like while(){ s/(\d)-/$1\t-/; print "$_"; } I'm pretty certain the OP wanted the data separated into fields so it would still have to be split. I do like the idea of adding the 'missing' space