Need Help Urgently

Bob Gailer bgailer at gmail.com
Wed Feb 26 12:21:29 EST 2020


On Feb 26, 2020 10:56 AM, "Prakash Samal" <prakashsamal0105 at gmail.com>
wrote:
>
> [ABCD client error]: Connection to broker at  126.0.0.1:0000 lost!
> "timestamp":"Wed Feb 19 11:48:41
>
> [XYZ]: Connection to broker at  126.0.0.1:0000 lost!
> "timestamp":"Wed Feb 19 11:48:40
>
> Note: I want to read the error code i.e ABCD Client error from the line
and also wrt timestamp value.

First a couple of pointers to help you get the results you want in future
communications.

Use a meaningful subject rather than help. Why? Because we keep track of a
communication thread by the subject. It also helps us decide whether or not
we can even tackle that particular problem.

Send such requests to tutor at python.org.

Understand that urgency on your part does not translate to urgency on our
part. We are volunteers who donate some of our time to giving help.

You can accomplish your objective by using various string processing
functions or by using regular expressions. I will assume that you want to
extract everything between square brackets as the error and everything
following the 2nd quote as the timestamp. Let's use the string find method.
With that you can get the index of a particular character and use string
slicing with those indexes to get the actual strings. If you have a basic
understanding of python that should be enough to get you started. Otherwise
I suggest you start with a tutorial that will get you those basics.

if you just want someone to write the program for you then one of us will
be glad to act as a paid consultant and do that for you.

Bob Gailer


More information about the Python-list mailing list