Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-13 Thread Matthew Bassett
=~ s/solar([^]*)\/solar/$1\n/g; Let us know how you get on. -- Matthew Bassett hewb...@gmail.com Sorry about the top posting- am replying from my phone. -Original Message- From: LeeGroups Sent: 12/07/2010 22:55:38 Subject: Re: [ubuntu-uk] [OT] Quick Perl question... $solar_info =~ s

Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-13 Thread Matthew Bassett
; -- Matthew Bassett hewb...@gmail.com Sorry about the top posting- am replying from my phone. -Original Message- From: Matt Wheeler Sent: 12/07/2010 23:46:32 Subject: Re: [ubuntu-uk] [OT] Quick Perl question... [some pruned text] You could remove both the start and end tags with something like

Re: [ubuntu-uk] [OT] Quick Perl question

2010-07-13 Thread Kevin Safford
New line characters in the substitution string, perhaps? Dot doesn't match those unless you modify the line: $solar_info =~ s/\/solar.*/,/s; -- Kevin Safford -- ubuntu-uk@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk https://wiki.ubuntu.com/UKTeam/

Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-12 Thread Thomas Ibbotson
On 12 July 2010 21:12, LeeGroups mailgro...@varga.co.uk wrote: $solar_info =~ s/\/solar.*/,/;  From my tinkerings, this should find the string /solar in the string $solar_info, and then remove it and any number of following characters (the .*) and then replace them with a ,. Except that it

Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-12 Thread LeeGroups
$solar_info =~ s/\/solar.*/,/; From my tinkerings, this should find the string /solar in the string $solar_info, and then remove it and any number of following characters (the .*) and then replace them with a ,. Except that it doesn't. It hacks out the /solar and replaces it with a , but

Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-12 Thread Jon Spriggs
So, why not do /solar(.*)\/solar/ ? -- Jon TheNiceGuy Spriggs On 12 Jul 2010 22:56, LeeGroups mailgro...@varga.co.uk wrote: $solar_info =~ s/\/solar.*/,/; From my tinkerings, this should find the string /solar... What's the input string? The following code simply prints , for me not

Re: [ubuntu-uk] [OT] Quick Perl question...

2010-07-12 Thread Matt Wheeler
On 12 July 2010 22:55, LeeGroups mailgro...@varga.co.uk wrote: This input solar8,27.31,28.68,28.81,0.00,0.00,0/solar It need to be -- 8,27.31,28.68,28.81,0.00,0.00,0 Another line chops off the solar. The problem is that occasionally there is rubbish on the end of the line, or even another