Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] Remove space in text file

Expand Messages
  • batch_lover
    I tried that before and the result is that its delete all the content of counter.txt
    Message 1 of 5 , May 1, 2010
    • 0 Attachment
      I tried that before and the result is that its delete all the content of "counter.txt"


      --- In batchworld@yahoogroups.com, Parag Doke <paragpdoke@...> wrote:
      >
      > Try the following line (removed the space):
      > echo %temp_counter%> counter.txt
      >
      > On Sat, May 1, 2010 at 4:08 AM, batch_lover <batch_lover@...> wrote:
      >
      > >
      > >
      > > Greeting,
      > >
      > > I made this incremental counter script
      > >
      > > for /f " delims==" %%i in (counter.txt) do set /A temp_counter= %%i+1
      > > echo %temp_counter% > counter.txt
      > >
      > > the content of counter.txt is :
      > > ---------
      > > 1
      > > ---------
      > >
      > > note: there's no space after the number 1
      > > When i execute the script i get this result:
      > >
      > > ---------
      > > 2 <--- there's a space after the result and i don't want that.
      > >
      > > ---------
      > >
      > > Now my question. How can i get rid of this annoying space ?
      > >
      > > Thanks :)
      > >
      > >
      > >
      >
      >
      >
      > --
      > Parag Doke
      > Save paper, save trees. Do not print emails/documents unless absolutely
      > necessary.
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Gonzalo Isaza
      Do ... This type of hard to find bugs and issues can easily be debugged with Running Steps by SteppingSoftware.com Hope this helps. On May 1, 2010, at 11:44
      Message 2 of 5 , May 1, 2010
      • 0 Attachment
        Do

        >counter.txt echo %temp_counter%

        This type of hard to find bugs and issues can easily be debugged with
        "Running Steps" by SteppingSoftware.com

        Hope this helps.

        On May 1, 2010, at 11:44 AM, "batch_lover" <batch_lover@...>
        wrote:

        >
        >
        > I tried that before and the result is that its delete all the
        > content of "counter.txt"
        >
        > --- In batchworld@yahoogroups.com, Parag Doke <paragpdoke@...> wrote:
        > >
        > > Try the following line (removed the space):
        > > echo %temp_counter%> counter.txt
        > >
        > > On Sat, May 1, 2010 at 4:08 AM, batch_lover <batch_lover@...> wrote:
        > >
        > > >
        > > >
        > > > Greeting,
        > > >
        > > > I made this incremental counter script
        > > >
        > > > for /f " delims==" %%i in (counter.txt) do set /A temp_counter= %
        > %i+1
        > > > echo %temp_counter% > counter.txt
        > > >
        > > > the content of counter.txt is :
        > > > ---------
        > > > 1
        > > > ---------
        > > >
        > > > note: there's no space after the number 1
        > > > When i execute the script i get this result:
        > > >
        > > > ---------
        > > > 2 <--- there's a space after the result and i don't want that.
        > > >
        > > > ---------
        > > >
        > > > Now my question. How can i get rid of this annoying space ?
        > > >
        > > > Thanks :)
        > > >
        > > >
        > > >
        > >
        > >
        > >
        > > --
        > > Parag Doke
        > > Save paper, save trees. Do not print emails/documents unless
        > absolutely
        > > necessary.
        > >
        > >
        > > [Non-text portions of this message have been removed]
        > >
        >
        >


        [Non-text portions of this message have been removed]
      • foxidrive@lavabit.com
        On Sat, 01 May 2010 18:44:46 -0000, batch_lover ... echo %temp_counter% counter.txt The double appends to the file.
        Message 3 of 5 , May 1, 2010
        • 0 Attachment
          On Sat, 01 May 2010 18:44:46 -0000, "batch_lover" <batch_lover@...>
          wrote:

          >I tried that before and the result is that its delete all the content of "counter.txt"
          >
          >
          >--- In batchworld@yahoogroups.com, Parag Doke <paragpdoke@...> wrote:
          >>
          >> Try the following line (removed the space):
          >> echo %temp_counter%> counter.txt

          echo %temp_counter%>>counter.txt

          The double >> appends to the file.

          and this is the same but will work in more cases:


          >>counter.txt echo/%temp_counter%
        Your message has been successfully submitted and would be delivered to recipients shortly.