c# - NAnt - Get filename in folder that contains specific word -
c# - NAnt - Get filename in folder that contains specific word -
i ran situation easier filename within directory of file contains specific naming format. middle file name never changes origin , end can change.
for illustration of middle "_projectname_release_patch_" . there way me check if file name in directory using nant? if file have name, filename
?
similar sql command? %_projectname_release_patch_%
for lack of improve solution, did trick me. !
class="snippet-code-html lang-html prettyprint-override"> <property name="pattern" value="_projectname_release_patch_" /> <echo message="looking..." /> <foreach item="file" property="file"> <in> <items> <include name="${folder}\**.sql" /> </items> </in> <do> <property name="file" value="" /> <echo message="looking match of: ${pattern}" /> <regex pattern="(?'file'${pattern}.*)" input="${file}" failonerror="false" /> <if test="${string::get-length(file) > 0}"> <echo message="match: ${file}" /> <property name="file.path" value="${file}" /> </if> </do> </foreach> <property name="patternfile" value="${file.path}" /> <echo message="the file path :${patternfile}" />
c# nant
Comments
Post a Comment