Computer Hope
Microsoft => Microsoft DOS => Topic started by: Blisk on March 13, 2019, 03:59:26 AM
-
how to remove a $ charter from a text file?
I have a batch which write last logged in user into txt file so backup script knows which user profile to backup.
But problem is because sometimes login makes temporary profile and user get in login.txt name like
c:\log\mike\login.txt
mike$s
c:\log\john\login.txt
john$a
c:\log\julia\login.txt
julia$f
how to search for files login.txt which are in multiple folders and remove $ from string in login.txt file so I can get result
c:\log\mike\login.txt
mikes
c:\log\john\login.txt
johna
c:\log\julia\login.txt
juliaf
-
C:\>set string=joh$n
C:\>echo %string%
joh$n
C:\>set string=%string:$=%
C:\>echo %string%
john
-
this way I can slve only one login.txt file for john, what about others?
to search only $ and delete it out
-
Use FOR in the normal way to process all the text files.