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 8971633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:00:19+00:00 2026-06-15T18:00:19+00:00

I am having issues manipulating a text file to get my desired results. For

  • 0

I am having issues manipulating a text file to get my desired results.

For example, I have the following lines within a text file called sprocs.txt which was created from an svn diff, similar to this:

     M      https://localhost/svn/Repo/branches/projectA/sprocs/admin/foo.sql
     M      https://localhost/svn/Repo/branches/projectA/sprocs/foo2.sql
     M      https://localhost/svn/Repo/branches/projectA/sprocs/admin
     M      https://localhost/svn/Repo/branches/projectA/sprocs

I am trying to edit this file so that it keeps everything starting with /sprocs, but deletes each line that does not end in .sql. For example, the file above would return the following:

    /sprocs/admin/foo.sql 
    /sprocs/foo2.sql

BTW: I plan to have these commands be handled by nant. Any ideas anyone? Thanks in advance.

  • 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-06-15T18:00:21+00:00Added an answer on June 15, 2026 at 6:00 pm

    This would do the job using pure NAnt:

    <target name="go">
      <property
        name="file.path"
        value="C:\foo\sprocs.txt" />
      <foreach
        item="Line"
        in="${file.path}"
        property="line">
        <property
          name="MATCH"
          value="" />
        <regex
          pattern="(?'MATCH'/sprocs.*\.sql)$"
          input="${line}"
          failonerror="false" />
        <if test="${string::get-length(MATCH) > 0}">
          <echo message="match: ${MATCH}" />
          <!-- do whatever you want to do with your match -->
        </if>
      </foreach>
    </target>
    

    Not as elegant as palako’s solution but it also works.

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

Sidebar

Related Questions

I'm having issues with internet Explorer. I have a link which duplicates a file
Having issues displaying some websites within iframes. Live example of code This one works.
I have been having issues calling a background image in my CSS file. The
Having issues referencing $(this) from within a the nested ajax 'success' function... I know
Im having issues getting this to work, maybe its not even possible? I have
Im having issues vertically positioning text inside of a text input field in Firefox.
I having issues exporting a GridView to Excel for some reason. I have two
i'm currently having issues changing track information at the lock screen. I have managed
I'm having issues removing several of my href links that all have the same
I am having issues manipulating deeply nested lists in OCaml in the below context.

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.