Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2147
  • Last Modified:

How can I count records in an XML file

How can I count records in an XML file
0
lux sat
Asked:
lux sat
  • 3
  • 2
1 Solution
 
lux satTechnical ConsultantAuthor Commented:
How can I count RECORDS in an XML file
0
 
Mike EghtebasDatabase and Application DeveloperCommented:
XML represent a tree structure of nodes called "elements". You can count then (or, say, number of elements on each tree level, or something else related to the number of elements) using nearly any XML parser.

What language are you working with?
0
 
lux satTechnical ConsultantAuthor Commented:
<xml>
<candidates>
      <candidate>
                 <name>Record 1</name>
                 <address>address 1</address>
        </candidate>
         <candidate>
                 <name>Record 2</name>
                 <address>Address 2</address>
        </candidate>
    </candidates>
</xml>

From the above XML code I want to count the number of candidate <Candidate></Candidate>(The above has 2 records and I want to count for a long file that I have).

THANKS,
Lakshmi
1
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Yes, that is helpful yet in order for us to provide any sort of help you still need to answer eghtebas's question...
What language are you working with?
0
 
lux satTechnical ConsultantAuthor Commented:
I have loaded the XML file data into ACCESS database . I have about 1800 records in my Access table. Just wanted to know if the count is correct from the XML file.
0
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Ok, so you probably just need something like UltraEdit (or maybe Notepad+ might work, but regular Notepad and Wordpad won't) and then you can use the "Find" feature from the menu or Ctrl+F and enter     <candidate>     as the search term (including the <  > ) and UltraEdit has a "Count All" button in the find dialog. This count should line up with the number of candidate elements because there is exactly 1   <candidate>   string per element. Note that </candidate> and <candidates> won't be counted as long as you search as I said above, ie. include the <  > characters around candidate.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now