Replace ",**" with a linebreak using RegEx (or something else)

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-06-02T08:26:51Z Indexed on 2010/06/02 8:34 UTC
Read the original article Hit count: 180

Filed under:
|
|
|
|

I'm getting started with RegEx and I was wondering if anyone could help me craft a statement to convert coordinates as follows:

145.00694,-37.80421,9 145.00686,-37.80382,9 145.00595,-37.8035,16 145.00586,-37.80301,16

to

145.00694,-37.80421
145.00686,-37.80382
145.00595,-37.8035 
145.00586,-37.80301

(Strip off the last comma and value and turn it into a line break.)

I can't figure out how to use wildcards to do something like that. Any help would be greatly appreciated! Thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about regex