Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 325519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:13:27+00:00 2026-05-12T09:13:27+00:00

i have a directory which contains the following: -directory -another directory -meta.xml -yet another

  • 0

i have a directory which contains the following:

-directory
 -another directory
  -meta.xml
 -yet another directory
  -meta.xml
...

So it needs to find in every directory ‘meta.xml’, all by itself (so that i dont have to type in every directory at the code) And i want that with EVERY meta.xml file a command is done.

Is there ANY possible way to do this, and could this be quiet done because the command i was talking about gives a text line from that meta.xml file, and i would like to not see whats its doing, that you get something like this:

text from meta file 1
text from meta file 2
text from meta file 3

and not

meta.xml found
text from meta file 1
meta.xml found
text from meta file 2
meta.xml found
text from meta file 3

If thats not clear, just think that i would just to like it run quietly, ok. (/Q maybe?)

this is the command i was talking about:

findstr "<name>" meta.xml >temp1.lis
FOR /F "tokens=2 delims=>" %%i in (temp1.lis) do @echo %%i > temp2.lis
FOR /F "tokens=1 delims=<" %%i in (temp2.lis) do @echo %%i > temp3.lis

it needs to do this for every single meta.xml file and giving the output so you get a total list when you do

type temp3.lis

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:13:28+00:00Added an answer on May 12, 2026 at 9:13 am

    Ok, as far as I can tell, this should work:

    findmeta.cmd

    @echo off
    for /f "delims=" %%f in ('dir /b /s meta.xml') do (
        FOR /F "tokens=2 delims=>" %%i in ('findstr "<name>" %%f') do @echo %%i > temp2.lis
        FOR /F "tokens=1 delims=<" %%i in (temp2.lis) do @echo %%i >> temp3.lis
    )
    

    I modified your script part so answers are added to temp3.lis, instead of replacing it, and removed the use of the first temp file.

    If, in the end, what you’re looking for is what ever is between the tags, like
    <name>blahblah</name> (the blahblah part)

    this should do even faster, no temp files needed and one less for loop (broke into multiple lines for ease of reading, it all hold on a single line if needed.

    for /f "delims=" %%f in ('dir /b /s meta.xml') do (
        FOR /F "tokens=2 delims=><" %%i in ('findstr "<name>" %%f') do (
            @echo %%i >> temp3.lis
        )
    )
    

    Single line version:

    for /f "delims=" %%f in ('dir /b /s meta.xml') do FOR /F "tokens=2 delims=><" %%i in ('findstr "<name>" %%f') do @echo %%i >> temp3.lis
    

    Not sure which you prefer, IF this is what you’re looking for.

    EDIT:
    Ok I think I got it, but I’m not sure it’s gonna fix everything. Basically you want to change the tokens=2 to tokens=3 like this:

    for /f "delims=" %%f in ('dir /b /s meta.xml') do FOR /F "tokens=3 delims=><" %%i in ('findstr "<name>" %%f') do @echo %%i >> temp3.lis
    

    Now see if this works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a zip file which contains the following directory structure: dir1\dir2\dir3a dir1\dir2\dir3b I'm
If, for example, I have a directory which contains the following files: Test-20120626-1023.txt Test-20120626-0710.txt
I have a image folder which contains sub directory for each album of images
I have a directory where our deployments go. A deployment (which is itself a
I have a lib directory in my applications main directory, which contains an arbitrary
I have a zip file named test.zip which contains a directory named invoice. Inside
I have a tableView which lists the contents of the document directory. It contains
I have a use control which contains some ajax functionality. I made all necessary
On my server I have directory reset, which contains 3 files index.php , 1.php,
I have a file name logspath.txt which contain on the logs directory path on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.