Hello Regex Gurus,
I need help handling this particular situation
In a log file, I have a line like this,
2014-06-17 13:55:14: IncomingData: TMSUpdateCallback:
{ SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17
13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1"
A
Your approach is wrong, use find() to start the splitting with '='.
I shall send you code soon. Hold on.
No regex needed.
On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote:
> Hello Regex Gurus,
>
> I need help handling this particular situation
>
> In a log file, I have a line like this,
>
> 2014-
On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote:
> Hello Regex Gurus,
>
> I need help handling this particular situation
>
> In a log file, I have a line like this,
>
> 2014-06-17 13:55:14: IncomingData: TMSUpdateCallback:
> { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17
> 1
Better one;
import re
feedstr = '2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: {
SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17
13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1"
Account="PTBHK01" }';
start = feedstr.find('{');
s = feedstr[start+1:]
d
import re
feedstr = '2014-06-17 13:55:14: IncomingData: TMSUpdateCallback: {
SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17
13:54:19" DestID="" ExchangeTransCode="65725497 89897456 523 1"
Account="PTBHK01" }';
start = feedstr.find('{');
s = feedstr[start+1:]
def spaceinquo
On Tue, Jun 17, 2014 at 9:57 PM, Mohan R wrote:
> Hello Regex Gurus,
>
> I need help handling this particular situation
>
> In a log file, I have a line like this,
>
> 2014-06-17 13:55:14: IncomingData: TMSUpdateCallback:
> { SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0 TradeTime="2014-06-17
>
Hi Uday,
Nice solution. Hat off !!!
function code using your re.
import re
data='SourceID=JP000456712 Ric=0388.HK BuyQty=3800.0
TradeTime="2014-06-17 13:54:19" DestID="" ExchangeTransCode="65725497
89897456 523 1"Account="PTBHK01"'
def parse_input(data):
my_dict={}
#convert into a list
On Wed, 2014-06-18 at 14:48 +0530, Udaya Kumar wrote:
> How are you? If this is related to office work, then you owe me! :)
> Check whether this fits your req.
Yeah :) I owe you a drink party!!
> result = re.findall("\w+=.+?(?=\s+\w+=|\s+})",feedstr,re.M|re.I|re.X)
wow!! I never thought there is