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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:30:14+00:00 2026-06-01T02:30:14+00:00

When echo ing to a file. echo is printing extra tabs before what is

  • 0

When echoing to a file. echo is printing extra tabs before what is printed.

I do not want these tabs there, why is ant doing this and how do i prevent?

Only using ant and/or ant-contrib. Nothing else.

<target 
    name="doThis">
    <delete 
        file="${PATH}/install.bat" 
        failonerror="true">
    </delete>

    <touch file="${PATH}/install.bat"></touch>

    <echo
        file="${PATH}/install.bat"
        level="verbose"
        append="true"
        message="if exist preinstall.bat call preinstall.bat${line.separator}">
    </echo>

    <foreach 
        trim="true"
        target="printStuff"
        param="stuffName">
        <path>
            <fileset dir="${basedir}/stuff/"></fileset>
        </path>
    </foreach>
</target>

<target 
    name="printStuff">
    <basename file="${stuffName}" property="stuffNameSmall"/>
    <echo
        file="${PATH}/install.bat"
        append="true"
        level="verbose"
        message="${stuffNameSmall}${line.separator}">
    </echo>
</target>

Example of output that is being printed currently:

<tab><tab>filename
<tab><tab>filename
<tab><tab>filename
  • 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-01T02:30:16+00:00Added an answer on June 1, 2026 at 2:30 am

    My hunch: you have 2 tab chars inside the <echo …> </echo> xml element…

    Try:

    <echo
        file="${PATH}/install.bat"
        append="true"
        level="verbose"
        message="${stuffNameSmall}${line.separator}" />
    

    The ‘echo’ task will print out the ‘message’ attribute value, as well as everything inside the nested text node. So best to always close the tag immediately if you don’t need to printout extra stuff (like multi-line ASCII art, oh yeah!).

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

Sidebar

Related Questions

i use $.getJSON and here is my php file echo:ing back jsonstring for($i=1; $i<=10;
I've got a php file echoing hashes from a MySQL database. This is necessary
I'm echoing a php string variable into html <span class=title_resource> <?php echo $titulo; ?>
echo timezone_name_from_abbr(, 3600*7, 0); //ok echo timezone_name_from_abbr(, 3600*8, 0); //NOT ok! return nothing! echo
I wonder if there is a way to hide html tags when echoing a
I am trying to copy Demo.jar file (generated by an ant task) on my
While echoing a form from PHP with some predefined value retrieved from file from
I am echoing TSV data and turning it into an excel file via header()
I am using file_put_contents($file, $data); function for putting contents in file, because these files
I am having problems echoing a property to a file. I am pretty sure

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.