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

Author Topic: remove charter from a text files  (Read 3158 times)

0 Members and 1 Guest are viewing this topic.

Blisk

    Topic Starter


    Intermediate

    Thanked: 1
    • Experience: Familiar
    • OS: Windows 7
    remove charter from a text files
    « 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

    Salmon Trout

    • Guest
    Re: remove charter from a text files
    « Reply #1 on: March 13, 2019, 10:44:55 AM »
    Code: [Select]
    C:\>set string=joh$n
    C:\>echo %string%
    joh$n
    C:\>set string=%string:$=%
    C:\>echo %string%
    john

    Blisk

      Topic Starter


      Intermediate

      Thanked: 1
      • Experience: Familiar
      • OS: Windows 7
      Re: remove charter from a text files
      « Reply #2 on: March 13, 2019, 11:11:34 AM »
      this way I can slve only one login.txt file for john, what about others?
      to search only $ and delete it out

      Salmon Trout

      • Guest
      Re: remove charter from a text files
      « Reply #3 on: March 13, 2019, 11:18:02 AM »
      Use FOR in the normal way to process all the text files.