01JAN 06:49:30.439 WARNING - Entered Zone - Operator = 5, Body Part = Body, u = 75830967.07, v = 45233540.51, w = 0.00, delta = 3
From the above line how to print Entered zone and delta
3 1446
If the input format is always constant, split the input data using "split". -
val = input('')
-
l = val.split(',')
-
m = l[0].split('=')
-
n = l[5].split('=')
-
x = m[1]
-
y = n[1]
-
print(x,y)
-
If there is a line feed code after delta = x, the following code works. -
f = open('filename')
-
val = f.readline()
-
while val:
-
l = val.split(',')
-
m = l[0].split('= ')
-
n = l[5].split('= ')
-
if ('Entered Zone' in m[0]):
-
x = m[1]
-
y = n[1]
-
print(x,y)
-
val = f.readline()
-
f.close
-
One space after "delta = x" followed by the next data. -
f = open('filename')
-
val = f.readline()
-
f.close
-
val2 = val.replace(' ',',')
-
word = val2.split(',')
-
flg1 = False
-
flg2 = False
-
enterd = ''
-
delta = ''
-
i = 0
-
for elem in word:
-
if word[i] == 'Entered':
-
enterd = word[i+5]
-
flg1 = True
-
if flg1 == True and word[i] == 'delta':
-
delta = word[i+2]
-
flg2 = True
-
if flg1 and flg2:
-
print(enterd,delta)
-
flg1 = False
-
flg2 = False
-
i = i + 1
-
01JAN 06:49:30.439 WARNING - Entered Zone - Operator = 5, Body Part = Body, u = 75830967.07, v = 45233540.51, w = 0.00, delta = 3 01JAN 06:49:30.439 WARNING - Entered Zone - Operator = 5, Body Part = Body, u = 75830967.07, v = 45233540.51, w = 0.00, delta = 1 01JAN 06:49:30.439 WARNING - EXITED - Operator = 5, Body Part = Body, u = 75830967.07, v = 45233540.51, w = 0.00, delta = 2 01JAN 06:49:30.439 WARNING - Entered Zone - Operator = 5, Body Part = Body, u = 75830967.07, v = 45233540.51, w = 0.00, delta = 4
FILE consists of those lines i have get the lines containing Entered Zone and print the delta value
It look like there is no line break and there is no comma only after delta = x, so it is impossible with the previous post way.
I think that After "delta = x", there will be an operation to separate by "split" with a space.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rob Meade |
last post by:
Lo all,
Ok - I'm adding site search functionality to a database driven website.
I have a list of 390 stop/ignore words, having looked at ASPFAQ already I
see that the example uses an array,...
|
by: Branden |
last post by:
hi guys,
i was wondering if it is possible to extract selected words in a
field to be put in different fields automatically. Do i have to write
the code in vb?
This is what im trying to do....
|
by: Brian |
last post by:
Hello all..
Been having some more trouble with the hit lines in my Air Hockey
game.
I have some hit lines drawn (and loaded into an array, Lines) around
the borders of my table to repel the...
|
by: Toska |
last post by:
Hi
Wonder how the should use the Regex members to add markup code to words
in a text.
Code:
--------------------
string words1 = "dog|cat|pig|horse|hippo";
|
by: akelly_image |
last post by:
Okay, if anyone could toss me some idea's here, please bare with my
noobish questions, I just picked up VB2005 Pro about a week ago. ( no
prior VB at all )
Here's my issue..
I'm pulling...
|
by: elrondrules |
last post by:
Hi
Am pretty new to python and hence this question..
I have file with an output of a process. I need to search this file one
line at a time and my pattern is that I am looking for the lines...
|
by: reecevdm |
last post by:
Hi, is it possible to have to match a specific word and change the color of that word?
What I need to do, is for a content, the color needs to be black. But if a specific word is matched in the...
|
by: sejal17 |
last post by:
hello everyone,
I have a problem to find a specific words from url.How can we find specific words from url?pls answer me as soon as possible.......
|
by: Marco Langes |
last post by:
Hello,
first of all: Excuse me for some bad English you might experience during the reading of this.
So I made this form with an textarea, people can write a comment in here but I wanted to...
|
by: ramniwas74 |
last post by:
i want to find some specific words from a paragraph and print them into a label as suppose i have a paragraph:"madam I am Adam" and now i want to search "madam and Adam" from this parapgraph my code...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |