Announcement

Collapse
No announcement yet.

INI file Key/Property Grammar Rule

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

  • INI file Key/Property Grammar Rule

    Greetings,

    After searching around the forum and throughout the web for an answer and not finding one that solves my problem/I can understand, I've decided to ask for help here.
    So I'm a total noob when it comes to programming but thing is, I'm trying to edit some files to create a translation mod for a game. Basically I have to edit multiple .ini files and when the game updates sometimes there are a few new entries on those files and using a software to compare the new file with the old translated one would be great, and that's why I chose BC 4.

    What I'm trying to do is create a grammar rule so that it tells me if there is any difference between the files, but only on the Key names (name=value in .ini files as far as I know), since all values are text shown inside the game and they're all translated, consequently being different all the time. The names on the other hand does not change, so I could use them to track new additions to the game text.
    So far what I've done is:
    • Delimited grammar rule;
    • Text from: "^";
    • To: "=" (the quotation marks are just to specify which terms I've added, they're not used inside BC4);
    • Escape character left blank;
    • Stop at the end of line left checked and unchecked with no difference found;
    • Match character case left checked and unchecked with no difference found;
    • Regular expressions left unchecked;
    • This element is case sensitive left checked and unchecked with no difference found.
    After that when I enable only this rule, GC finds no difference, even tough I've left one line intentionally different between the files.
    PS.: I'm using INI Files Sorted as format (https://www.scootersoftware.com/rules/IniSort.zip).

    Any help is appreciated, if I've posted on the wrong section please forgive me.
    Best regards,
    Igor

  • #2
    The file format you listed is for Beyond Compare 2.

    To compare INI files sorted and only show name differences in Beyond Compare 4:

    Download and install the INI files file format from the Additional File Formats for Beyond Compare 4 page:
    https://www.scootersoftware.com/down...atform=Windows

    Load a pair of INI files in the Text Compare.
    Click the Rules toolbar button (referee icon).
    In the Importance tab, click Edit Grammar.
    In the top half of the Grammar tab, click +.
    Element name: Name
    Category: Basic
    Text matching: ^\w+=
    Check regular expression.
    Leave This element is case sensitive unchecked.
    Click OK.
    Click OK.
    In the Importance tab, uncheck everything except Name.
    Click OK.

    In the main window, if View > Ignore Unimportant Differences is turned on, only name differences should be colored red.
    Chris K Scooter Software

    Comment


    • #3
      Thank you for the quick reply Chris,

      I made a mistake when posting, I already had the one you linked. The one I linked is one I previously had downloaded but BC 4 did not accept warning me that it was really a BC 2 format.

      Anyway, I did as you said but it still does not work. One thing I realized is that with one single file it had a line identified but the only difference is that the text was like name=value and the other one was name = value, with space between the words, all other lines I've seen in this game's files have those spaces between the key name and the value, could this be the cause somehow?

      Thank you again,
      Igor

      Comment


      • #4
        Yes, the instructions I listed won't work if there's a space between name and =.

        To match on both name= and name =, use the regular expression: ^\w+ *=

        If you continue to have trouble, please email a pair of example files and your Beyond Compare settings to support@scootersoftware.com and we'll provide more specific instructions. To save your settings to a file, open Help > Support and click the Export button.


        Chris K Scooter Software

        Comment


        • #5
          Well, that worked like a charm. Thank you very much Chris, problem solved.

          Best regards,
          Igor

          Comment

          Working...
          X