Announcement

Collapse
No announcement yet.

Sync left to right in file comparison saved sessions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sync left to right in file comparison saved sessions

    Hi all,
    So there are directory comparison saved sessions and file content comparison saved sessions.
    I know how to script a 'sync left to right' on a directory saved session.
    I do not know how to script a 'sync left to right' of file content from the file on the left into the file on the right? Is this possible?
    Kind regards,
    Thomas

  • #2
    Hello,

    Yes, the graphical interface has both Folder Compare and Folder Sync session types, while scripting "loads" a Folder Compare session only. This is because the Folder Compare contains sync commands; the Folder Sync Session is a subset of the Folder Compare, with a larger preview pane and other interface options.

    I would first test this in the graphical interface. Load two test folders, since BC4 does not support an UNDO command, in the Folder Compare. Then, in the Actions menu -> Synchronize -> Sync Update Left to Right (or which sync you need). This will show a small preview box and show which items will sync (or be deleted if Mirror is used; again, no Undo command so please review).

    If this is working as expected, you can then perform the same actions with scripting, such as:
    load "c:\folder1" "c:\folder2"
    sync update:left->right

    The interface offers a preview of both the comparison and how files are aligning, and what the script expects to sync. Script offers no preview and will automatically act.
    Aaron P Scooter Software

    Comment


    • #3
      Thanks for the reply Aaron. Let's putt aside folder\file syncing to avoid misunderstandings.
      So what I'm trying to achieve is the copy of content from a xlsx file into a text file via scripting.
      Is there any solution to achieve this? Cheers!

      Comment


      • #4
        Hello,

        No, BC4 does not support converting a file from xlsx to .txt with bc scripting language. This is actually something we do in the background in order to open Excel files, using vbscripting. You can download the MS Excel Workbooks (white icon Text Compare) additional format, here:
        http://www.scootersoftware.com/downl..._moreformatsv4

        Rename the .bcpkg file to .zip, and you can look at the Helpers script to see how that conversion works.

        BC4 uses this in the background in order to present the XLSX file in the interface (or script) to generate reports, but the output would be in a Text Report (.txt, html, printer) as output. You can generate the different report types in the interface from the Session menu -> Text Compare Report or Table Compare Report, try out different layouts and options, and script can then generate the same reports if a combination is good for you.
        Aaron P Scooter Software

        Comment


        • #5
          Aaron, I spent a few hours beating my head against the wall trying to script a session, before stumbling across this post, and you provided me the answer, now my head doesn't hurt. Your product and website are fantastic... great work you do, and I thank you for that!

          Comment


          • #6
            Thank you Aaron. It's starting to make more sense.

            Monologue (self-reflection):

            OK, it's not perfect, but the 'text-only' report might be sufficient.
            Apparently a script such as the below can automate the creation of the report:
            text-report layout:side-by-side &
            options:ignore-unimportant,display-context &
            output-to:"%3" output-options:html-color "%1" "%2"


            If my saved session compares an empty file versus the target xlsx file, a script can be automated to make a report of everything in the xlsx file.
            The created file will have some unwanted lines at the beginning and spaces and -+ on the left side plus one unwanted line at the end.
            I'll have to see if I can control the filename of the output file.
            If yes, I can automate an ultraedit macro to remove the unwanted info and change the spaces to tabs '^t'.
            And presto there's the output file exactly how I want it.


            (for my own reference, see https://www.scootersoftware.com/v4he...e_scripts.html)

            Comment


            • #7
              Hello,

              BC4 itself doesn't support a table or multiple session inputs, so it would have to be some external solution to then call to our basic command line that calls to script and generates a text-report with two file inputs. Other parameters can insert as any text into the script, to customize it as needed.

              Script itself does not support loading a file session. It can load a Folder Compare Session, and then generate a file level report. Otherwise, you would need to update the default text compare session settings, which are then used by script (and any new graphical Text Compare or Folder Compare rules-based scan).
              Aaron P Scooter Software

              Comment

              Working...
              X