home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 68,420 of 68,980   
   Herbert Kleebauer to All   
   Re: Replace line in a txt file with miss   
   11 Jan 24 00:41:14   
   
   From: klee@unibwm.de   
      
   On 10.01.2024 21:59, Zaidy036 wrote:   
      
   > I simplified by removal of %_NN% and:   
   > - This current last one liner crashes the batch:   
   > FOR /F "USEBACKQ TOKENS=1,2 DELIMS=:" %%A IN ("F:\_NW-B.txt") DO (IF   
   > "%B"==" " ECHO %%A >> F:\_NW-N.txt)   
      
   Move "IF" to the next line, double the % and remove the space from "%B"==" "   
      
   FOR /F "USEBACKQ TOKENS=1,2 DELIMS=:" %%A IN ("F:\_NW-B.txt") DO (   
   IF "%%B"=="" ECHO %%A >> F:\_NW-N.txt)   
      
      
   But why do you use USEBACKQ?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca