Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to extract data from xml file using notepad++?

Tags:

xml

notepad++

I have a xml response with a structure ( e.g groups > subgroups > child records ).

I want to extract list of all childRecord.name as separate data. I was hoping i can do something quick in notepad++ and then paste the results in excel.

I am not sure how to go about writing a macro may be in this case that would do this for me.

<group>

  <subgroup>

    <childrecord name="abc">zzz</childrecord>

  </subgroup>

</group>
like image 701
dotnetcoder Avatar asked Jun 08 '12 20:06

dotnetcoder


People also ask

How do I open an XML file in Notepad?

To open XML Notepad, click Start, point to Programs, point to XML Notepad, and then click Microsoft XML Notepad. The interface shows two panes. The Structure pane on the left presents the beginning of an XML tree structure, with a Root_Element and Child_Element already created.

Can Notepad ++ Open XML files?

The XML file contains tags and strings with rules, So these files can be opened in notepad++ directly, modify and save the files.

How do I open XML file in text?

XML files are encoded in plaintext, so you can open them in any text editor and be able to clearly read it. Right-click the XML file and select "Open With." This will display a list of programs to open the file in. Select "Notepad" (Windows) or "TextEdit" (Mac).


1 Answers

Open the XML file with MS Excel directly.

Update

From support.office.com:

Import an XML data file as an XML table

  1. Click Developer > Import.

    If you don't see the Developer tab, see Show the Developer tab.

  2. In the Import XML dialog box, locate and select the XML data file (.xml) you want to import, and click Import.

    If the XML data file doesn't refer to a schema, Excel infers the schema from the XML data file.

  3. In the Import Data dialog box, do one of the following:

    a. Select XML table in existing worksheet to import the contents of the XML data file into an XML table in your worksheet at the specified cell location.

    b. Select XML table in new worksheet to import the contents of the file into an XML table in a new worksheet starting at cell A1. The schema of the XML data file is displayed in the XML Source task pane.

  4. If the XML data file doesn't refer to a schema, then Excel infers the schema >from the XML data file.

  5. To control the behavior of XML data (such as data binding, format, and layout), click Properties, which displays the XML Map properties dialog box. For example, existing data in a mapped range will be overwritten when you import data by default, but you can change this.

Import XML file in LibreOffice Calc:

  1. From the menu bar, go to Data > XML Source...
  2. Click on the browse button (folder icon) and choose the file from the dialog
  3. Select the desired node
  4. Fill the Mapped cell field for example A1
  5. Click on Import button.
like image 126
Farahmand Avatar answered Sep 30 '22 01:09

Farahmand