Announcement

Collapse
No announcement yet.

Unable to load base folder

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

  • Unable to load base folder

    Hello,

    I am working on a comparison files with Beyond Compare by using the script way to automate it.
    Few weeks ago I had managed to run it but results were wrong when I added in the BCSession the ignored columns...

    Today, I wanted to work on this problem, so I ran my scripts then I modified something and all gone wrong...

    04/11/2014 17:27:33 Fatal Scripting Error: Unable to load base folder

    I have this message, I am sure it's something really nut but I have spent all my day on it.

    Here is my launch_compare.cmd :

    Code:
    "C:\\Program Files (x86)\\Scooter Software\\Beyond Compare\\bcompare.exe" "@C:\\Users\\424242\\AppData\\Roaming\\Scooter Software\\Beyond Compare 3\\Comparison Automation\\bcscript.txt" "CRID_KONDOR.csv" "C:\Users\424242\AppData\Roaming\Scooter Software\Beyond Compare 3\Comparison Automation\Results\CRID_KONDOR_csv.txt"
    here is my bcscript.txt :
    Code:
    load "%1"
    expand all
    select all
    data-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:"%2" output-options:wrap-word
    And finally my BCSession.xml
    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Produced by Beyond Compare 3 from Scooter Software -->
    <BCSessions>
    	<TSessionFolder>
    		<Items>
    			<TDataCompareSession Value="CRID_KONDOR.csv">
    				<LastModified Value="2014-11-04 15:25:36"/>
    				<Specs>
    				      <Left Value="C:\Users\424242\Documents\POCBeyondCompare\ReferenceFiles\CRID_KONDOR.csv"/>
    					<Right Value="C:\Users\424242\Documents\POCBeyondCompare\ReferenceFiles\CRID_KONDOR.csv"/>
    				</Specs>
    			</TDataCompareSession>
    		</Items>
    	</TSessionFolder>
    </BCSessions>
    Please I need an external eye who can help me please.. Why I have this message whereas this morning it was working ?

  • #2
    Hello,

    BC Scripting's load command does not support loading a saved Data Compare session. You can load a pair of folders or a saved Folder Compare session. Given your script includes "expand all" and "select all", previous iterations probably loaded a Folder Compare session, selected the data-files within, and then generated a report on the selection. This is similar to opening the Folder Compare in the GUI, selecting files, then using the right-click or Actions menu to generate the File Compare Report (Data Report if only data files are selected).

    Alternatively, if you have two specific data files, you can load them directly by skipping load, expand, and select commands:
    "C:\\Program Files (x86)\\Scooter Software\\Beyond Compare\\bcompare.exe" "@C:\\Users\\424242\\AppData\\Roaming\\Scooter Software\\Beyond Compare 3\\Comparison Automation\\bcscript.txt" "c:\folderpath\CRID_KONDOR.csv" "c:\folderpath2\CRID_KONDOR.csv" ""C:\Users\424242\AppData\Roaming\Scooter Software\Beyond Compare 3\Comparison Automation\Results\CRID_KONDOR_csv.txt"

    Then in script use one line:
    data-report layout:side-by-side options:display-mismatches,ignore-unimportant output-to:"%2" output-options:wrap-word "%1" "%2"

    This would require editing the BCSessions.xml to update the default Data Compare session, as calling the data-report directly uses the default. I would suggest first loading the graphical interface, loading a blank Data Compare session, opening your two files, altering the Session Settings, and then generating the report. Once this report is as you expect, you can then open the BCSessions.xml to verify how it would need to be edited. Editing directly without performing this step to verify how we auto-generate session settings is often difficult or takes longer to troubleshoot.
    Aaron P Scooter Software

    Comment


    • #3
      Thank Aaron,

      Your answer helped me to resolve the problem. As you said
      BC Scripting's load command does not support loading a saved Data Compare session
      So I have modified my BCSession.xml like this :

      HTML Code:
      <?xml version="1.0" encoding="UTF-8"?>
      <!-- Produced by Beyond Compare 3 from Scooter Software -->
      <BCSessions>
      	<TDataCompareSession Value="CRID_KONDOR.csv">
      		<LastModified Value="2014-11-04 15:25:36"/>
      				<Specs>
      			<Left Value="C:\Users\424242\Documents\POCBeyondCompare\ReferenceFiles\CRID_KONDOR.csv"/>
      			<Right Value="C:\Users\424242\Documents\POCBeyondCompare\ReferenceFiles\CRID_KONDOR.csv"/>
      		</Specs>
      	</TDataCompareSession>
      	<TSessionFolder>
      		<Items>
      
      		</Items>
      	</TSessionFolder>
      </BCSessions>
      And it does resolve my problem ! The comparison is done !!

      I wanted to ask you a last thing, have you any adivce to have a result output which can be easier to read ?
      (my result.txt can weight over 750Ko and all columns from the two files on the same line)

      Comment


      • #4
        For smaller reports, you can output as HTML, then open the HTML in Microsoft Excel and save it as an Excel file for further formatting. If your text output report is 750KB it might be too large for a web browser to open without performance issues.
        Chris K Scooter Software

        Comment


        • #5
          Thank you Chris.

          The point is that when I compare the two files with the keys defined, I have only 7 mismatches.

          And when I run the same comparison with command line, by editing the BCSession.xml, I have everything in mismatches or unmatches (maybe).

          I put this XML between <BCSessions> tags and outside of <TSessionFolder>

          HTML Code:
          <TDirCompareSession Value="F02_IACC_TD02-FAC-997_test.txt and F02_IACC_TD02-FAC-997_test.txt">
          		<Defaults>
          			<TDataCompareSession Value="">
          				<Rules>
          					<Cols>
          						<Keys Value="21,22,26"/>
          					</Cols>
          				</Rules>
          				<State>
          					<DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
          				</State>
          			</TDataCompareSession>
          		</Defaults>
          		<Filters>
          			<NameFilter Value="F02_IACC_TD02-FAC-997.txt"/>
          		</Filters>
          		<Formats>
          			<Left Value="CRI_FACIL_Format"/>
          			<Right Value="CRI_FACIL_Format"/>
          		</Formats>
          		<LastModified Value="16/07/2014 16:14:28"/>
          		<Specs>
          			<Left Value="C:\Users\424242\Documents\POCBeyondCompare\Test_Automation_06112014\Comparaison de fichiers\Dev_BDDF"/>
          			<Right Value="C:\Users\424242\Documents\POCBeyondCompare\Test_Automation_06112014\Comparaison de fichiers\Prod_BDDF"/>
          		</Specs>
          	</TDirCompareSession>
          I believe that it does not take nto account my keys.
          So if my comparison would work, my output file should not be heavier that 1000Ko

          Comment


          • #6
            Hello,

            To test the current default values, launch the graphical interface, click the Data Compare button to launch a new, blank Data Compare, then drag and drop your two files into the panes. Does this correctly mark the Key columns?

            If so, that would indicate that the script is running as a different Windows User than the GUI (and edited files). Settings are stored per Windows User account, so if the script is running as a different user, then it would have its own set of defaults.
            Aaron P Scooter Software

            Comment


            • #7
              Hello !

              I found my problem, I had a wrong file format... I mean I had the same as the one defined before but it did not take it into account... So now I have the right result !

              But I still have a problem, I hope it will be the last one ! I spent all the day with a collegue on it. When I had everything in mismatches, ccolumns were defined in the result

              Click image for larger version

Name:	columns.png
Views:	1
Size:	29.8 KB
ID:	76301

              And then, when I got right results, Columns had disappeared and instead of it I have a mismatched row...

              Click image for larger version

Name:	nocuolumns.png
Views:	1
Size:	29.5 KB
ID:	76302

              So I have looked in the FileFormat.xml, and when I had modified this part of the xml (comment fmt width, fmtFixed etc...), I can have my columns but everything in mismatches, or no columns but the right result...

              HTML Code:
              	<TDataFormat>
              		<DlmDelimiters Value="124"/>
              		<DlmDetect Value="False"/>
              		<DlmTrimWS Value="False"/>
              		<FmtWidths Value="25;25;8;17;17;1;25;8;8;6;8;8;10;1;12;12;17;8;8;27;10;10;5;15;5;20;5;5;10;1;18;3;1;1;18;3;1;1;18;3;1;5;5;5;5;10;1;8;8;3;6;1;5;15;15;1;3;1;10;20;5;1;1;28;9;1;5;18;8;18;3;1;8;2;15;15;20;34;3;1;3;1;1;1;15;18;15;1;18;2;5;5;1;1;12;12;12;1;1;3;1;2;10;1;18;3;1;1;1;23;6;15;15;1;1;1;43;1"/>
              		<FmtType Value="fmtFixed"/>
              		<HasNames Value="True"/>
              		<HasNamesDetect Value="False"/>
              	</TDataFormat>
              I am a bit lost with this part and I haven't found anything on internet about it
              Have you got an idea to get the right result with the defined columns ?

              and Finally I want to thank you a lot for all your previous answer they helped me a lot !

              Comment


              • #8
                Hello,

                Thanks. Similar to my previous suggestion, I always recommend troubleshooting in the interface first. It provides more feedback than an automated result, and settings should be shared between. For this, what do you see if you load the GUI, a new blank Data Compare, then drag and drop your files into the interface (of this new, default Data Compare)?

                Do the columns define as you expect, or are the values perhaps off by 1? Fixed Width columns can be tricky to define, as if the definition or file has a small offset, it pushes everything out of bounds of a column, and can make the whole file different.

                If everything appears within proper columns, where is the difference occurring within each row?
                Aaron P Scooter Software

                Comment


                • #9
                  Hello Aaron,

                  The results expected was finally wrong, I had hasardous the same differences with the GUI and the command line comparison. When I tried with another file the numbers of differences was not the same between the GUI and the command line way.

                  I have try to run BC GUI with a blank Session I have opened my two files, and then editing the setting (keys, fileformat). Next I opened the BCSession, everything was ok. I ran my command line (I tried differents ways). And I did not get the right results.

                  So, we decided to try the TDirCompareSession which contains its own TDataCompare with the wanted file name, wanted keys, and the wanted FileFormat. But the result was wrong too...

                  Is it possible to run a comparison in command line which takes into account the File Format with a TDirCOmpareSesssion ?


                  Note : Here is the File Format generated by BC when we defined it (it is a fixed one):
                  HTML Code:
                  	<TDataFormat Value="CRI_FACIL_Format">
                  		<FmtType Value="fmtFixed"/>
                  		<FxdWidths Value="25;25;8;17;17;1;25;8;8;6;8;8;10;1;12;12;17;8;8;27;10;10;5;15;5;20;5;5;10;1;18;3;1;1;18;3;1;1;18;3;1;5;5;5;5;10;1;8;8;3;6;1;5;15;15;1;3;1;10;20;5;1;1;28;9;1;5;18;8;18;3;1;8;2;15;15;20;34;3;1;3;1;1;1;15;18;15;1;18;2;5;5;1;1;12;12;12;1;1;3;1;2;10;1;18;3;1;1;1;23;6;15;15;1;1;1;43;1"/>
                  	</TDataFormat>
                  Note II : We currently use Beyond Compare v3.1.11.12204
                  Last edited by Chaveex; 14-Nov-2014, 04:14 AM.

                  Comment


                  • #10
                    Hello,

                    Instead of editing the Key, please be sure that the default is currently already edited, so upon dragging and dropping the files into a new, blank Data Compare, it uses these new defaults and properly shows the files without any editing needed. If any editing is needed, then the defaults are not correctly configured.

                    You can edit the defaults on the Home screen in the Saved Sessions list, in the Edit session defaults folder, or within the compare in the Session Settings dialog, update from "Use for this view only" to "Also update session defaults".

                    Are you able to get this step working, where opening your files directly in the GUI works, without any editing or altering of Session Settings? Then try the script as the same Windows User account that uses the GUI.

                    If updating is an option, I would suggest that, too. All BC3.x updates are free for 3.x users. You can get the latest version from the Help menu -> Check for Updates, or from here:
                    http://www.scootersoftware.com/download.php?zz=dl3_en
                    Aaron P Scooter Software

                    Comment


                    • #11
                      Hello Aaron,

                      I finally got Beyond Compare 4 after waiting for 2 weeks (security process) and tried what you told with the default values.

                      When I have edited my keys and file format and "Also update session defaults", I had the result I expected. So then I tried to run it with the command line, and finally great I had the expected result too !

                      The thing is that I have to compare around 80 files with their own file format and their own keys.

                      For example the first one will be :

                      F03_IACC_TD02-FEES-12309.txt
                      with the following file Format : CRI_FEES_Format (25;25;8;17;17;1;25;8;8;6;8;8;10;1;12;12 [its longer in reallity])
                      and these keys : 5;22;25;26;81

                      And the next file will be :

                      F02_IACC_TD02-FAC-997.txt
                      with the following file Format : CRI_FACIL_Format(10;10;5;15;5;20;5;5;10;1;18;3;1;1 ;18;3;1;1;18;3;1;5;6;5;5;5;5;10 [normally longer])
                      and these keys : 21;22;26

                      And I would like to compare them (80 files) automatically with multiple command line and only one BCSession...
                      I tried this

                      HTML Code:
                      <BCSessions Version="1" MinVersion="1">
                      	<TSessionFolder>
                      		<Items>
                      			<TSessionFolder>
                      				<Items>
                      					<TDataCompareSession Value="F02_IACC_TD02-FAC-997.txt">
                      						<LastModified Value="2014-11-24 15:00:43"/>
                      						<Rules>
                      							<Cols>
                      								<Keys Value="21;22;26"/>
                      							</Cols>
                      						</Rules>
                      						<Specs>
                      							<Left Value="F:\Users\424242\XXXX\POCBeyondCompare\Rick\Rick_Setup\Dev_BDDF\F02_IACC_TD02-FAC-997.txt"/>
                      							<Right Value="F:\Users\424242\XXXX\POCBeyondCompare\Rick\Rick_Setup\Prod_BDDF\F02_IACC_TD02-FAC-997.txt"/>
                      						</Specs>
                      						<State>
                      							<DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                      						</State>
                      					</TDataCompareSession>
                      					<TDataCompareSession Value="F03_IACC_TD02-FEES-12309.txt">
                      						<Formats>
                      							<Left Value="CRI_FEES_Format"/>
                      							<Right Value="CRI_FEES_Format"/>
                      						</Formats>
                      						<LastModified Value="2014-11-24 14:46:53"/>
                      						<Rules>
                      							<Cols>
                      								<Keys Value="5;22;25;26;81"/>
                      							</Cols>
                      						</Rules>
                      						<Specs>
                      							<Left Value="F:\Users\424242\XXXX\POCBeyondCompare\Rick\Rick_Setup\Dev_BDDF\F03_IACC_TD02-FEES-12309.txt"/>
                      							<Right Value="F:\Users\424242\XXX\POCBeyondCompare\Rick\Rick_Setup\Prod_BDDF\F03_IACC_TD02-FEES-12309.txt"/>
                      						</Specs>
                      						<State>
                      							<DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                      						</State>
                      					</TDataCompareSession>
                      				</Items>
                      			</TSessionFolder>
                      			<TDataCompareSession>
                      				<Formats>
                      					<Left Value="CRI_FEES_Format"/>
                      					<Right Value="CRI_FEES_Format"/>
                      				</Formats>
                      				<Formats>
                      					<Left Value="CRI_FACIL_Format"/>
                      					<Right Value="CRI_FACIL_Format"/>
                      				</Formats>
                      				<Rules>
                      					<Cols>
                      						<Keys Value="5;22;25;26;81"/>
                      					</Cols>
                      				</Rules>
                      				<Rules>
                      					<Cols>
                      						<Keys Value="21;22;26"/>
                      					</Cols>
                      				</Rules>
                      				<State>
                      					<DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                      				</State>
                      				<State>
                      					<DisplayFilter Value="[showLeftMod, showRightMod, showDiffMod]"/>
                      				</State>
                      			</TDataCompareSession>
                      		</Items>
                      	</TSessionFolder>
                      </BCSessions>
                      But As I expected it does not work and just take the last format or keys...

                      I'm working on it for 1 month now and I have not found a solution yet, Do you think it's possible ?

                      Comment


                      • #12
                        Not with a series of sessions in the sessions.xml. Instead, you need to have a non-BC script which edits the XML while Beyond Compare is not running. This would edit the default session to have the proper keys, and *then* launch bcompare.exe @script.txt. This way, the defaults are set, then the program is run.

                        This is not an ideal workaround, but we do not support setting keys on the command line. We can only use the default session settings. If they need to change between each call, then the xml needs to be updated to do so. It's on our wishlist to expand/enhance this support.
                        Aaron P Scooter Software

                        Comment

                        Working...
                        X