Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Write to file with echo and use \n  (Read 2411 times)

0 Members and 1 Guest are viewing this topic.

vgsangiuliano

    Topic Starter


    Greenhorn

    Write to file with echo and use \n
    « on: January 28, 2009, 03:22:31 AM »
    Hi i'm wondering if there is way to append text to some file going to the next line.
    For exampe if my text file is text.txt and contains the line this is an example using echo this is another example>>text.txt the results is in the file text.txt is:

    this is a examplethis is another example  while i would like to have

    this is an example
    this is another example


    Thank you

    fireballs



      Apprentice

    • Code:Terminal
    • Thanked: 3
      Re: Write to file with echo and use \n
      « Reply #1 on: January 28, 2009, 03:35:12 AM »
      Code: [Select]
      echo.>>test.txt That will append a blank line onto test.txt

      FB
      Next time google it.

      Biker Steve



        Rookie

        Re: Write to file with echo and use \n
        « Reply #2 on: February 13, 2009, 06:19:48 AM »

        Using only one ">" within the @echo command will either create a new "test.txt file" if one does not already exist or over write the contents of the "test.txt" file should one already exist.

        @echo This will create a file with new contents > test.txt

        Using two ">>" within thin the @echo command will append this line to the existing "test.txt" file.

        @echo This will append this line to the end of the file >> test.txt