Requesting - "how to" for creating logs of just filenames.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LanceZ
    New User
    • Aug 2013
    • 2

    Requesting - "how to" for creating logs of just filenames.

    Hello! I'm tinkering around with BC3 and attempting to automate the creation of very simple filename output files. Reviewing the help documentation, I don't see how to do this.

    Desired scenario:
    1. Load the folders to compare - we'll call them Folder 1 and Folder 2 for this scenario.
    2. Do a binary diff check between the two folders, ignoring folder structures.
    3. Output the filenames from Folder 1 that have been changed into an Updated.txt file.
    4. Output the filenames from Folder 1 that are orphans into a New.txt file.
    5. Output the file names from Folder 2 that are orphans into a Old.txt file.


    The key is I want the same output I would get if I selected all from right or left column in the UI, right-clicked, and selected "Copy File Name".

    Examples:

    Updated.txt would have something like:
    C:\Folder1\SubFolder1\file.wav
    C:\Folder1\SubFolder1\file.wav

    New.txt would have something like:
    C:\Folder1\SubFolder1\file.wav
    C:\Folder1\SubFolder12\file.wav

    Old.txt would have something like:
    C:\Folder2\whyisthisevenhere.txt
    C:\Folder2\SubFolder1\oldfile.wav

    And so on...

    Question:

    Can someone show me a script sample of how to get this basic text output in an automated fashion?

    Is it possible? I can't figure out the format.

    If there's a thread on this, a link to that would be appreciated as well - I may have missed it!

    Thanks much for your time! Love this tool, btw! I just need to learn how to automate it!
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hi Lance,

    There are a couple of hurdles I see that could make this a bit tricky, but doable. The first is that scripting does not directly support the flattened folder view as a scripting variable. However, script does support loading a session, and a session can be the flattened folder setting with no folders. Sequentially, script can then load a pair of folders into this session, essentially loading those two folders in a flattened view.

    First, in the graphical interface, load up a new, blank Folder Compare, and change the view mode to Ignore Folder Structure. Then use the Session menu -> Save Session, "FlatFoldersSession".

    Close FlatFolderSession, and now, in scripting you can use two load commands side by side:
    load FlatFoldersSession
    criteria binary
    load "c:\folder1" "c:\folder2"
    folder-report layout:summary options:display-left-newer-orphans output-to:"c:\updated.txt"

    We do not have a report type that is only the file names, but the Summary report (combined with different display options) should be close to your needs. Alternatively, you could use the XML report type, and use another script to parse out and generate the exact reports you require. Do either of these meet your needs? Detailed documentation can be found in the Help file -> Scripting Reference chapter - Folder-report. We have additional scripting information in the Using Beyond Compare -> Automating with Script chapter.
    Aaron P Scooter Software

    Comment

    • Aaron
      Team Scooter
      • Oct 2007
      • 16000

      #3
      I should add that the session saved in the graphical interface can also do more. You could set your criteria here, or even the pair of folders you wish to compare. The more settings saved as part of the session, the less the script needs to specifically configure.
      Aaron P Scooter Software

      Comment

      • LanceZ
        New User
        • Aug 2013
        • 2

        #4
        Thank you Aaron - I will start with this and see how it works out. I appreciate the assistance!

        Comment

        Working...