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

Author Topic: Break line while appending files  (Read 3281 times)

0 Members and 1 Guest are viewing this topic.

rancrazy

    Topic Starter


    Rookie

    Break line while appending files
    « on: April 15, 2009, 12:57:08 PM »
    Hi
      Is there any way we can add  a break line while appending  *.txt to some other file?
    for example
    test1.txt contents
    a b c d
     test2.txt contents
    1234
    test3.txt contents
    a b c d
    **********
    1 2 3 4

    COPPY test1 + test2 test3 appends the files but I want to add break line in between.
    echo ***************>>test3 adds at the end of line but I need a break line while each file is appending.
    Please advice.

    Dias de verano

    • Guest
    Re: Break line while appending files
    « Reply #1 on: April 15, 2009, 01:11:37 PM »
    Don't use COPY.

    Use TYPE to avoid the last line problems.
    Code: [Select]

    TYPE test1.txt > test3.txt
    echo ***********>>test3.txt
    TYPE test2.txt >> test3.txt


    rancrazy

      Topic Starter


      Rookie

      Re: Break line while appending files
      « Reply #2 on: April 15, 2009, 01:15:34 PM »
      Dias,
        this solution works good for two files where we can mention file name but I need for all *.txt in a folder.
      Any idea please??

      Dias de verano

      • Guest
      Re: Break line while appending files
      « Reply #3 on: April 15, 2009, 01:17:48 PM »
      Yes. Use FOR loop to parse output of DIR with appropriate switches and append files one by one

      rancrazy

        Topic Starter


        Rookie

        Re: Break line while appending files
        « Reply #4 on: April 15, 2009, 01:53:17 PM »
        Oh! thanks for the tip Dias