Batch (BAT) scripting to append to file without new line

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aiko27
    New Member
    • Sep 2008
    • 5

    #1

    Batch (BAT) scripting to append to file without new line

    Hi

    I would like to create a batch file (bat) where it outputs some text (either by echo or calling some other script) and append to an existing text file. However, everytime a > (or >>) is used, it automatically adds a new line afterwards. How can this be avoided please?

    For example,

    echo a > text.txt
    echo b > text.txt
    echo c > text.txt
    "....... calling some other java script..... " > text.txt
    echo d > text.txt
    echo e > text.txt

    This would make the text.txt file look like something like this:

    a
    b
    c
    hello
    d
    e

    My goal is to make the content of text.txt to look like this:

    abchellode

    Can you please help?...

    Many thanks!
  • jg007
    Contributor
    • Mar 2008
    • 283

    #2
    I do quite a lot of batch files but I am not sure how to do that , if you are using vbscriot anyway can you not use that to add the text?

    Comment

    Working...