I need to use ant to append some text to multiple files in a directory. I know I can use the echo command but how can I apply it to multiple files selected by a wildcard?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
You could do this by means of the Ant
replaceregexptask. For example this will append to all the.txtfiles in the specified directory:The
flagsandmatchattrributes in this case configure the task to append only to the end of the file.You man need to make use of the
${line.separator}property in your append text if it is multiline.