home bbs files messages ]

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

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

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

   Message 40,582 of 42,547   
   matthew.eve@gmail.com to All   
   open newest file & then replace + with 0   
   21 Nov 12 08:32:35   
   
   I am looking for some help. I am in the process of writing a batch file that   
   will open the newest file in the directory:   
      
   @echo off   
   set folder=C:\directory\   
   for /f "tokens=1 delims=" %%a in ('dir /b /o:d "%folder%"') do set newest=%%a   
   if not "%newest%"=="" echo Newest file is "%newest%"   
   if not "%newest%"=="" echo Full path: "%folder%\%newest%"   
   Exit   
      
   the second part I need is to have batch file look for any +'s in the file and   
   replace with 0's   
      
   example of current line 01G030160|G04C|G0501|G0601|G07A|G0801|G09+00032.00|   
   final result            01G030160|G04C|G0501|G0601|G07A|G0801|G09000032.00|   
      
   Then save the same in the same directory but with different name.   
      
   any help would be appreciated.   
      
   Matt   
      
   --- 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