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.
This would do the job using pure NAnt:
Not as elegant as palako’s solution but it also works.