4 Replies Latest reply: Feb 22, 2013 7:27 AM by chris227 RSS

    String search

    Rahul_India
      I have 200 files xml files stored in the directory.How can i search for the files containing particular string below
      SupplyDetail>
      <SupplierIdentifier>
      <SupplierIDType>NA</SupplierIDType>
      <IDTypeName>NA</IDTypeName>
      <IDValue>NA</IDValue>
      </SupplierIdentifier>
      </SupplyDetail>
      i wrote this but its not working
      findstr /i /m "<SupplyDetail>
      <SupplierIdentifier>
      <SupplierIDType>NA</SupplierIDType>
      <IDTypeName>NA</IDTypeName>
      <IDValue>NA</IDValue>
      </SupplierIdentifier>
      </SupplyDetail>" *.xml
        • 1. Re: String search
          _Karthick_
          Rahul India wrote:
          I have 200 files xml files stored in the directory.How can i search for the files containing particular string below
          SupplyDetail>
          <SupplierIdentifier>
          <SupplierIDType>NA</SupplierIDType>
          <IDTypeName>NA</IDTypeName>
          <IDValue>NA</IDValue>
          </SupplierIdentifier>
          </SupplyDetail>
          i wrote this but its not working
          findstr /i /m "<SupplyDetail>
          <SupplierIdentifier>
          <SupplierIDType>NA</SupplierIDType>
          <IDTypeName>NA</IDTypeName>
          <IDValue>NA</IDValue>
          </SupplierIdentifier>
          </SupplyDetail>" *.xml
          This is an Oracle SQL and PL/SQL forum. And i dont find your question any way related to this forum.
          • 2. Re: String search
            Manik
            findstr is dos command.
            Please check this:
            /i -- ignore case
            /m -- Display only file name.

            But the string you are searching has an extra '<' ... Check that and may be below command can help.

            Just an educational guess ;)
            findstr /i /m "SupplyDetail>
            <SupplierIdentifier>
            <SupplierIDType>NA</SupplierIDType>
            <IDTypeName>NA</IDTypeName>
            <IDValue>NA</IDValue>
            </SupplierIdentifier>
            </SupplyDetail>" *.xml
            Or may be google it : http://www.codeproject.com/Articles/11786/Searching-multiple-XML-files

            Cheers,
            Manik.

            Edited by: added link
            • 3. Re: String search
              Rahul_India
              how to match multi line strings
              • 4. Re: String search
                chris227
                Example:
                C:\TEMP>type test.xml
                SupplyDetail>
                <SupplierIdentifier>
                <SupplierIDType>NA</SupplierIDType>
                <IDTypeName>NA</IDTypeName>
                <IDValue>NA</IDValue>
                </SupplierIdentifier>
                </SupplyDetail>
                C:\TEMP>type search.txt
                SupplyDetail>
                <SupplierIdentifier>
                <SupplierIDType>NA</SupplierIDType>
                <IDTypeName>NA</IDTypeName>
                <IDValue>NA</IDValue>
                </SupplierIdentifier>
                </SupplyDetail>
                C:\TEMP>findstr /m /i /G:search.txt *.xml
                test.xml