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

Author Topic: auto increment for filename and file content  (Read 3030 times)

0 Members and 1 Guest are viewing this topic.

only_lonely

    Topic Starter


    Intermediate
    auto increment for filename and file content
    « on: July 11, 2010, 09:57:16 AM »
    how to append a new line into texts?
    i got full of codes at file1.txt
    test abcdefg a1
    nmjkloi
    ddkkkoll

    and i want to auto generate 1000 files, the file name increase by +1 and the number after a (a1) also increase by +1
    so i have
    file2.txt (a2)
    file3.txt (a3)
    ....file1000.txt (a1000)


    carlos55



      Starter

    • USA
      Re: auto increment for filename and file content
      « Reply #1 on: July 16, 2010, 02:35:58 AM »

      C:\test>type  only.bat

       @echo off

      rem echo nmjkloi  >> file1.txt



      for /L %%i in (1,1,1000) do (
      echo %%i
      set ck=%%i
      echo  hello >> file%%ia%%i.txt

      rem if %ck%==10  goto :end

      )
      :end
      type file*.txt
      rem echo nmjkloi  >> file1.txt


      rem [email protected]
      C:\test>
      USA

      Salmon Trout

      • Guest
      Re: auto increment for filename and file content
      « Reply #2 on: July 16, 2010, 04:49:36 AM »
      Cool new name, Bill.