Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
added 119 characters in body
Source Link
yael
  • 14k
  • 72
  • 220
  • 377

we can find xml file type as the follwing

find /tmp/ -type f -name '*.xml'

but how to change the syntax in order to find only xml that contain with:

<Name>some words</Name>

and print what is between:

<Name> ------ </Name>

expected output

some words      

example - xml file contain:

<Name>files_with_extra_data</Name>

expected output

files_with_extra_data

we can find xml file type as the follwing

find /tmp/ -type f -name '*.xml'

but how to change the syntax in order to find only xml that contain with:

<Name>some words</Name>

and print what is between:

<Name> ------ </Name>

expected output

some words      

we can find xml file type as the follwing

find /tmp/ -type f -name '*.xml'

but how to change the syntax in order to find only xml that contain with:

<Name>some words</Name>

and print what is between:

<Name> ------ </Name>

expected output

some words      

example - xml file contain:

<Name>files_with_extra_data</Name>

expected output

files_with_extra_data
Source Link
yael
  • 14k
  • 72
  • 220
  • 377

find xml file that contain specific tag name and print the words between tag name

we can find xml file type as the follwing

find /tmp/ -type f -name '*.xml'

but how to change the syntax in order to find only xml that contain with:

<Name>some words</Name>

and print what is between:

<Name> ------ </Name>

expected output

some words