Read a file in a bat file

  1. Posts : 57
    Windows 10

    Read a file in a bat file

    I have to read a file thru a bat file and get the date in the file.
    Once I get the date, I need it to be passed to be appended to another file.
      My Computer

  2. Posts : 11,645
    Windows 10 Home x64 Version 21H2 Build 19044.1776

    This will get you started with reading the file.
    batch - refer to CSV and have an if statement check against for target text - Stack Overflow

    To append something to another file, you'd use something like this
    echo "Whatever it is I've found" >>TargetFile.txt
    The >> appends it, a single > would write it to a new file i.e. any original one would get overwritten and only the new bit would be in it.

      My Computer


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 15:00.
Find Us

Windows 10 Forums