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

Author Topic: add comma in the begining of each row by batch  (Read 2323 times)

0 Members and 1 Guest are viewing this topic.

garyypk

    Topic Starter


    Rookie

    add comma in the begining of each row by batch
    « on: May 07, 2008, 01:13:06 AM »
    hello, how to add comma in the begining of each row by using batch file?
    thanks

    Carbon Dudeoxide

    • Global Moderator

    • Mastermind
    • Thanked: 169
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Experience: Guru
    • OS: Mac OS
    Re: add comma in the begining of each row by batch
    « Reply #1 on: May 07, 2008, 02:47:26 AM »
    What exactly do you mean?

    Where do you want the comma to be?

    garyypk

      Topic Starter


      Rookie

      Re: add comma in the begining of each row by batch
      « Reply #2 on: May 07, 2008, 03:29:34 AM »
      o, i have solved this problem~~thanks
      and i would like to ask another question:

      If I want to import 10 files in a folder, how to write a batch script in order to import those 10 files? I mean how to read the number of files in that folder and write a loop for doing that?

      thanks!!

      .bat_man

      • Guest
      Re: add comma in the begining of each row by batch
      « Reply #3 on: May 07, 2008, 04:59:39 AM »
      try this
      for /f "tokens=1" %%i in ('dir ^| find " File(s)"') do echo %%i

      garyypk

        Topic Starter


        Rookie

        Re: add comma in the begining of each row by batch
        « Reply #4 on: May 07, 2008, 05:11:48 AM »
        o,i m sorry i can't test it?

        .bat_man

        • Guest
        Re: add comma in the begining of each row by batch
        « Reply #5 on: May 07, 2008, 05:17:13 AM »
        why it will print the count of files in a directory u are in

        garyypk

          Topic Starter


          Rookie

          Re: add comma in the begining of each row by batch
          « Reply #6 on: May 07, 2008, 05:50:34 AM »
          i have made your command into a bat file, a.bat. then i run it. It displays the command only but not the variable.

          .bat_man

          • Guest
          Re: add comma in the begining of each row by batch
          « Reply #7 on: May 07, 2008, 06:05:42 AM »
          C:\**\Desktop\ttt>a.bat

          C:\**\Desktop\ttt>for /F "tokens=1" %i
           in ('dir | find " File(s)"') do echo %i

          C:\**\Desktop\ttt>echo 4
          4


          .bat_man

          • Guest
          Re: add comma in the begining of each row by batch
          « Reply #8 on: May 07, 2008, 06:08:59 AM »
          can u make a DIR command on ur prompt and show me the result it prints