Bulk copying of text files, but with new extension  

Page 2 of 2 FirstFirst 12

  1. Posts : 473
    Windows 10
    Thread Starter
       #11

    Thanks, missed it earlier. It sure does look brilliantly simple - but can you clarify how to implement it? I'm nervous to run it as it stands, as it appears to have no specific target or limitation!

    Running it in a Command window after a cd command like this:

    C:\Users\terry>cd C:\BulCopy-Level1-Parent Folder

    C:\BulCopy-Level1-Parent Folder> copy *.ino *.txt
    CanShaker-9-OK.ino
    1 file(s) copied.

    C:\BulCopy-Level1-Parent Folder>

    only added to the file in that single folder. No recursion.


    As you'll have gathered, I'm not a programmer or techie, just an experienced end user. But still keen to learn new stuff.
      My Computer


  2. Posts : 6,181
    Windows 11 Pro - Windows 7 HP - Lubuntu
       #12

    Terrypin said:
    Thanks, missed it earlier. It sure does look brilliantly simple - but can you clarify how to implement it? I'm nervous to run it as it stands, as it appears to have no specific target or limitation!

    Running it in a Command window after a cd command like this:

    C:\Users\terry>cd C:\BulCopy-Level1-Parent Folder

    C:\BulCopy-Level1-Parent Folder> copy *.ino *.txt
    CanShaker-9-OK.ino
    1 file(s) copied.

    C:\BulCopy-Level1-Parent Folder>

    only added to the file in that single folder. No recursion.


    As you'll have gathered, I'm not a programmer or techie, just an experienced end user. But still keen to learn new stuff.
    So you want the batch to create a txt file on all sub folders. Sorry, my mistake. My batch only creates a txt file on the folder it is in.
      My Computers


  3. Posts : 699
    Windows 7
       #13

    I'm disappointed no one checked if any of the *.ino files got updated.

    Run this BAT script (with a hidden PowerShell script inside), and change the folder path.

    It will check for missing files, and overwrite existing ones if they don't match. I researched if Dropbox supported hard or symbolic file links to save disk space, and the sad answer is they don't work correctly. Oh well.

    C:\Users\GARLIN\Downloads>Terry.BAT
    Scanning folders...
    Copying G:\src\Terrypin\test1.txt
    Copying G:\src\Terrypin\test4.ino.txt
    Copying G:\src\Terrypin\A\test2.txt
    Copying G:\src\Terrypin\A\B\test3.txt
    Done.

    C:\Users\GARLIN\Downloads>Terry.BAT
    Scanning folders...
    Replacing G:\src\Terrypin\A\B\test3.txt
    Done.
    Bulk copying of text files, but with new extension Attached Files
      My Computer


  4. Posts : 473
    Windows 10
    Thread Starter
       #14

    I'm disappointed no one checked if any of the *.ino files got updated.

    Not sure I follow you garlin? As mentioned, I tested das10s solution and it met all of the requirements Id specified. Including subsequent updates. If an .ino gets updated by whatever means, running the batch will then create a copy of it with a .txt extension.
      My Computer


  5. Posts : 3,266
    Win10
       #15

    Terry - to explain;

    Basically, whilst on each run, my bat file would overwrite 'all' existing duplicated .txt files (whether the corresponding .ino files have changed or not), Garlin's script checks the hashes of any .txt files against their corresponding .ino files, and only overwrites those .txt files where the hashes of the duplicated .txt files don't match. Where a duplicated .txt file doesn't exist, his script creates it as well.

    In that sense, his is a sync script which is more efficient in that it prevents any unnecessary overwrites of unchanged files.
      My Computers


  6. Posts : 473
    Windows 10
    Thread Starter
       #16

    das10, garlin:

    Got it, thanks!
      My Computer


  7. Posts : 7,607
    Windows 10 Home 20H2
       #17

    Megahertz said:
    That is quite easy.
    @Matthew Wai or @Paul Black are very good on batch files and can help you. Wait for them.
    Unfortunately, one of them has become a Linux user and has thus forgotten about batch scripting.
      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 05:04.
Find Us




Windows 10 Forums