LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parsing and counting occurrence of string.

Hello all! greetings hope all are doing great.I'm developing on Labview application which will parse the XML document after that i have to search one particular value  e:g "connectionretrystatuscount=1" so we will search whole XML file how many times connection retry ==1 value occurred and and we will display this count to user. We have to parse so many files located under one folder. can someone suggest basic. Ignore my poor english. Any help will be great!

Message 1 of 8
(1,896 Views)

Seems pretty straightforward.  Where are you stuck?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 2 of 8
(1,866 Views)

Let me unpack that request a little.

 

"search whole XML file"... Hint: xml file is just a text file
"have to search for 'connectionretrystatuscount=1'" ... use a string search (match) inside a loop
"display this count to user"... Sounds like a numerical indicator to me
"parse so many files located under one folder" ... another loop with an array of the files to search

 

As billko said, seems pretty straight forward. Where is the problem?

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 3 of 8
(1,849 Views)

1. I tried searching the particular string but it is giving output as 0.

 

2.Parsing so many files ( around 500) located under 1 folder this seems difficult to implement.

 

3.and finally i should get one dashboard on front panel like this refer to attachment user output.

 

4.Attachment XML data reference is XML data i'm using

 

5.Attachment search retry count is searching for string Retry count=1 in whole XML

 

 

please find attached VIs and expected outcome this is my first assignment and im just a biginner in LABVIEW and i'm finding it interesting to learn so giving my best. any help will be grateful.

 

Thanks for your response Frozen and bilko!!

 

Message 4 of 8
(1,831 Views)

Hi billko thank you so much for your response i have attached the Vis if you get little time suggest me few steps. It will be helpful. Have a great day

Message 5 of 8
(1,830 Views)

First, xml is just a text file. Simple string searches will work. No need to try and parse the xml structure if a simple search will work.

Let me post a picture of example code for you... 

 

image.png

 

Getting a list of files is pretty straight forward too... here is another IMAGE (Photo or Picture) for you to look at.

 

Frozen_1-1608652482728.png

I have done ALL the work for you... Nice little present for you during these festive times 🙂

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 6 of 8
(1,812 Views)

Man No words for you!! I'm from mechanical engineering background trying to learn LabVIEW on my own. Since last 18 hr i was doing this stuff and you helped me within 1 day. God bless you!! This gave me motivation to learn LabVIEW in depth. Merry Christmas to you Man really Thank you so much!!! Keep supporting whole LabVIEW community.

Message 7 of 8
(1,804 Views)

I wonder what should go in here. we have to call N number of files one by one to search for particular string as mentioned .. this part i'll try.. Thanks you so much

Message 8 of 8
(1,776 Views)