Hi,
I am parsing an xml file ,and one part of structure looks
something like this:
- <COMPARAM id="_338" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_AX </SHORTNAME>
<LONGNAME>Timeout N_As/N_Ar</LONGNAME>
<DESCRIPTION>Time from transmit request until a CAN frame transmit
confirmation is received.</DESCRIPTION>
</COMPARAM>
In my code i am extracting the data within
<LONGNAME>,which is Timeout N_As/N_Ar.These tags repeat and will have
different timer names..like
- <COMPARAM id="_339" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_BS </SHORTNAME>
<LONGNAME>Timeout N_Bs</LONGNAME>
<DESCRIPTION>Time that the transmitter of a multi-frame message
shall wait to receive a flow control (FC) frame before timing out with
a network layer error.</DESCRIPTION>
</COMPARAM>
I need to remove the words Timeout from the data,and
take only the abbrevation..i.e.N_As/N_bs like that .In short i have to
remove the words which come with name Time,and also the space which
comes next to it.
and take only the abbreviation.Can someone help me in this.
Thanks 4 4848
On May 14, 2007, at 12:56 AM, sa**********@gmail.com wrote:
Hi,
I am parsing an xml file ,and one part of structure looks
something like this:
- <COMPARAM id="_338" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_AX </SHORTNAME>
<LONGNAME>Timeout N_As/N_Ar</LONGNAME>
<DESCRIPTION>Time from transmit request until a CAN frame transmit
confirmation is received.</DESCRIPTION>
</COMPARAM>
In my code i am extracting the data within
<LONGNAME>,which is Timeout N_As/N_Ar.These tags repeat and will have
different timer names..like
- <COMPARAM id="_339" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_BS </SHORTNAME>
<LONGNAME>Timeout N_Bs</LONGNAME>
<DESCRIPTION>Time that the transmitter of a multi-frame message
shall wait to receive a flow control (FC) frame before timing out with
a network layer error.</DESCRIPTION>
</COMPARAM>
I need to remove the words Timeout from the data,and
take only the abbrevation..i.e.N_As/N_bs like that .In short i have to
remove the words which come with name Time,and also the space which
comes next to it.
and take only the abbreviation.Can someone help me in this.
Thanks
Assuming you're naming the string 'logname' and the only space is
between the Time* word and the tags, this should work: logname.split()
[-1]
In <11*********************@o5g2000hsb.googlegroups.c om>, saif.shakeel
wrote:
Hi,
I am parsing an xml file ,and one part of structure looks
something like this:
- <COMPARAM id="_338" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_AX </SHORTNAME>
<LONGNAME>Timeout N_As/N_Ar</LONGNAME>
<DESCRIPTION>Time from transmit request until a CAN frame transmit
confirmation is received.</DESCRIPTION>
</COMPARAM>
In my code i am extracting the data within
<LONGNAME>,which is Timeout N_As/N_Ar.These tags repeat and will have
different timer names..like
- <COMPARAM id="_339" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_BS </SHORTNAME>
<LONGNAME>Timeout N_Bs</LONGNAME>
<DESCRIPTION>Time that the transmitter of a multi-frame message
shall wait to receive a flow control (FC) frame before timing out with
a network layer error.</DESCRIPTION>
</COMPARAM>
I need to remove the words Timeout from the data,and
take only the abbrevation..i.e.N_As/N_bs like that .In short i have to
remove the words which come with name Time,and also the space which
comes next to it.
and take only the abbreviation.Can someone help me in this.
You can test for the prefix with the `startswith()` method and use string
slicing to create a new string without the prefix:
In [3]: prefix = 'Timeout '
In [4]: longname = 'Timeout N_Bs'
In [5]: longname.startswith(prefix)
Out[5]: True
In [6]: longname = longname[len(prefix):]
In [7]: longname
Out[7]: 'N_Bs'
Ciao,
Marc 'BlackJack' Rintsch
On May 13, 10:56 pm, saif.shak...@gmail.com wrote:
Hi,
I am parsing an xml file ,and one part of structure looks
something like this:
- <COMPARAM id="_338" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_AX </SHORTNAME>
<LONGNAME>Timeout N_As/N_Ar</LONGNAME>
<DESCRIPTION>Time from transmit request until a CAN frame transmit
confirmation is received.</DESCRIPTION>
</COMPARAM>
In my code i am extracting the data within
<LONGNAME>,which is Timeout N_As/N_Ar.These tags repeat and will have
different timer names..like
- <COMPARAM id="_339" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_BS </SHORTNAME>
<LONGNAME>Timeout N_Bs</LONGNAME>
<DESCRIPTION>Time that the transmitter of a multi-frame message
shall wait to receive a flow control (FC) frame before timing out with
a network layer error.</DESCRIPTION>
</COMPARAM>
I need to remove the words Timeout from the data,and
take only the abbrevation..i.e.N_As/N_bs like that .In short i have to
remove the words which come with name Time,and also the space which
comes next to it.
and take only the abbreviation.Can someone help me in this.
Thanks
Did you get elementtree working?
On May 14, 1:04 pm, half.ital...@gmail.com wrote:
On May 13, 10:56 pm, saif.shak...@gmail.com wrote:
Hi,
I am parsing an xml file ,and one part of structure looks
something like this:
- <COMPARAM id="_338" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_AX </SHORTNAME>
<LONGNAME>Timeout N_As/N_Ar</LONGNAME>
<DESCRIPTION>Time from transmit request until a CAN frame transmit
confirmation is received.</DESCRIPTION>
</COMPARAM>
In my code i am extracting the data within
<LONGNAME>,which is Timeout N_As/N_Ar.These tags repeat and will have
different timer names..like
- <COMPARAM id="_339" DDORef="_18" Semantics="timing"
PhysicalLink="Infotainment_Control_Bus_CAN">
<SHORTNAME>Infotainment_Control_Bus_CAN_TIMEOUT_BS </SHORTNAME>
<LONGNAME>Timeout N_Bs</LONGNAME>
<DESCRIPTION>Time that the transmitter of a multi-frame message
shall wait to receive a flow control (FC) frame before timing out with
a network layer error.</DESCRIPTION>
</COMPARAM>
I need to remove the words Timeout from the data,and
take only the abbrevation..i.e.N_As/N_bs like that .In short i have to
remove the words which come with name Time,and also the space which
comes next to it.
and take only the abbreviation.Can someone help me in this.
Thanks
Did you get elementtree working?- Hide quoted text -
- Show quoted text -
Thanks for thr replies.It helped a lot.
Regarding the element tree problem,the module error is gone but a new
problem has appeared,which i have posted in new thread, This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: scott |
last post by:
Below, I'm trying to remove the querystring name& value of "catID=12".
I mananged to isolate the RESULTS part, but I need to be able to strip the
querystring name and it's value, no matter if the...
|
by: sameer mowade via .NET 247 |
last post by:
Hello All,
I have problem while dynamically removing row from the Datagrid which i have added dynamically as shown in the following code snippet. The problem is that while removing dynamically...
|
by: Peter Row |
last post by:
Hi,
I am currently working on a VB.NET project that has been going for quite a
while.
In the past it has been developed with a lot of compatibility VB6 functions
and
constants, e.g Left(),...
|
by: Niyazi |
last post by:
Hi all,
What is fastest way removing duplicated value from string array using vb.net?
Here is what currently I am doing but the the array contains over 16000
items. And it just do it in 10 or...
|
by: bruce |
last post by:
hi...
i'm running into a problem where i'm seeing non-ascii chars in the parsing
i'm doing. in looking through various docs, i can't find functions to
remove/restrict strings to valid ascii...
|
by: Mumia W. |
last post by:
Hello all.
I have a C++ program that can count the YOYOs that are in a grid of
Y's and O's. For example, this
Y O Y O O Y
O Y O Y O O
Y O Y Y O Y
O Y O O Y O
O Y Y O Y O
|
by: MikeT |
last post by:
This may sound very elementary, but can you trap when your object is
set to null within the object?
I have created a class that registers an event from an object passed
in the constructor. When...
|
by: svarc |
last post by:
In reference to: How to remove a variable length word from a string
I'm trying to use the code you suggested to shalini for extracting a substring from a string...but not able to do so...
|
by: ramu |
last post by:
Hi,
Suppose I have a string like this:
"I have a string \"and a inner string\\\" I want to remove space in
this string but not in the inner string"
In the above string I have to remove...
|
by: Ahmed, Shakir |
last post by:
I need to remove text string from the list of the numbers mentioned
below:
080829-7_A
070529-5_c
080824-7_O
070405_6_p
The output will be : 080829-7
070529-5
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
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: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |