UC - Two Excel files comparison - word wrapping problem

UC - Two Excel files comparison - word wrapping problem

3
NewbieNewbie
3

    17:43 - Jul 03#1

    Hello,
     
    After having used UltraCompare to see the changes between two big multi-sheets Excel files, I couldn't find a way to wrap the text to fit the window (some cells have veeeery long lines, it’s really difficult to check something), it seems that there is no “hidden” option, so I did a backup/report in HTML format (the "print-in-a-pdf-file" option gave me very bad results). I had to do that for each tab of the Excel Workbook (don't know if there is a possibility to have just one file).
     
    The output gave me a nice table with two columns, the only drawback is the size of each column. Like in UC main window, I have to scroll from left to right and right to left to read the document in MS Edge (or Firefox).

    I think a good trick would be to edit the HTML file (the table part, which seems to have a fixed layout) but I’m not familiar with new HTML/CSS coding. Is there an option in UC to have a better layout aka text wrapping in each column to fit the browser window? Or does someone know which part of the code I must edit and what should be the code?

    Sorry for my bad english.

    Thanks 

    Patrick

    6,686585
    Grand MasterGrand Master
    6,686585

      19:56 - Jul 04#2

      It would be easier for us helping you if we would have two similar example Excel files with cells with very long values which we could compare with UltraCompare and look if we can find options to get the differences in long cell values easier to see. Please use the button Full Editor & Preview and attach a 7-Zip, RAR or ZIP archive file with the two example Excel files demonstrating the issue seeing the different characters in very long cell values.

      Do you know the commands Next Difference Characters and Previous Difference Characters which exist in addition to Next Difference and Previous Difference?

      These two commands move the display for showing the different characters in a line (row) with selecting the different characters in active pane (left/right or top/bottom depending on using vertical or horizontal layout). If there is nothing selected in the active pane, there are characters deleted or not existing in this pane while in the other pane are the characters still existing or were added. Make the other pane active and use the commands there to get selected the characters existing in only one of the two panes.

      It could be also useful enabling Just Differences - Just Different Rows in menu View. I prefer the toolbar/menu mode and not the default ribbon mode. Let us know which user interface mode is used by you for making it easier for us to describe where the commands can be found on a ribbon or on a toolbar or in a menu.

      I recommend further enabling Show Active Line Window which shows just the two selected lines of the two file panes above/below each other with a horizontal scrollbar which helps a lot seeing the different characters extra highlighted in this small window at the bottom with just the two lines.

      The command Toggle Word-Wrap is not available in table compare mode. The word-wrap feature can be used only in text compare mode.

      PS: All my *.xlsx Excel files are real table calculations and not CSV files with text data. I could create two *.xlsx Excel files with lots of text data as typically stored in CSV files created on data export from a database. But my self-created Excel files are perhaps displayed with my configuration settings so that I can easily see the differences. It is better you provide two sample files which you compared with UltraCompare and where it is hard for you to find the different characters. We could use the two files and make screenshots for showing you how the differences are shown on using specific options as described above.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        17:47 - Jul 05#3

        So...

        I've received a translation in an Excel workbook that I've edited, and the client asks me to indicate any changes made (difficult in Excel as there's no option to track changes as there is in Word). So I created two Excel 2016 workbooks, one with the translation, XL_1, the other with the revision, XL_2, and ran a comparison in UltraCompare (2024.00.0.23 64-bit).

        First problem: there's no word/line-wrapping when comparing Excel workbooks, but as the left scrollbar is synchronized with the right scrollbar, this isn't a big deal, even if it would be MUCH better if the text could fit the window. But this problem doesn't interest my customer, who doesn't own UC and I won't suggest him to buy it.

        q_UC.PNG (83.99KiB)

        Second problem: I wanted to save the result in HTML. A workaround?
        The output is nice, two columns, with the modifications clearly visible BUT, whereas I expected the table columns, the table and the text to adapt to the size of the browser window, I get two FIXED columns/table, I have to use the browser scrollbars to see everything and it's painstaking, I can't decently present this to my customer.

        So I had the idea to edit the HTML source code, but I confess I'm a bit lost, especially with CSS. I looked in the W3C CSS2 specifications and found some things (like table-layout, word-wrap), but I haven't been able to implement them (which, how, where).

        I can't understand why the CSS/HTML template (I suppose) used to produce the output doesn't include the possibility/feature of automatically adjusting the table columns and the text they contain to the browser window. Why fixed widths? Is there a fix?

        Here's the CSS code which, I think, could be modified:

        Code: Select all

        <style>
              body {
                font-family: sans-serif;
                font-size: .75em;
              }
              table.uc {
                margin: 0;
                padding: 0;
                border: 1px solid #999EA2;
                border-collapse: collapse;
              }
              table.uc th {
                padding: .45em .5em .45em 0;
                vertical-align: text-top;
                font-size: 1.2em;
                font-weight: bold;
                text-align: left;
                color: #2d3740;
                background-color: #F4F4F4;
                border-bottom: 1px solid #999EA2;
              }
              table.uc td {
                padding: .2em 0 .2em .4em;
                vertical-align: text-top;
                color: #595F62;
                font-family: "Consolas", "Lucida Console", Monaco, monospace;
                font-size: 1em;
              }
              table.table td {
                padding-right: .4em;
                border: 1px solid #999EA2;
                border-collapse: collapse;
              }
              table.table td.separ {
                border: 0px;
              }
              table.uc th.filename {
                padding-left: .3em;
              }
              table.uc td.diff {
                color: #000000;
                background-color: #ddebff;
              }
              table.uc td.missing_line {
                background: repeating-linear-gradient(
                to right,
                white,
                white 9px,
                #CED6D9 1px,
                #CED6D9 10px
                );
              }
              table.uc td.ln {
                background: #F4F4F4;
                padding: 0 .5em;
              }
              table.uc td.symbol {
                text-align: center;
                background: #F4F4F4;
                padding: 0 .3em 0 0;
              }
              table.uc td.table_header,
              table.uc td.row_num {
                padding-right: .5em;
                text-align: center;
                font-weight: bold;
                color: #909090;
                background-color: #FAFAFA;
              }
              table.uc td.row_num {
                text-align: right;
              }
              .text_diff {
                color: #E10000;
              }
              .diff_bin {
                font-weight: bold;
                background-color: #ddebff;
              }
              table.summary {
                margin: 0 0 .75em 0;
                padding: 0;
              }
              table.summary td {
                padding: 0 1em;
              }
              table.summary td.summary_value {
                border-right: 1px solid #B0BABF;
              }
              table.summary td.summary_label {
                font-weight: bold;
                padding: 0;
              }
              table.summary td:last-of-type {
                border-right: 0;
              }
            </style>
        Note: I can't send the Excel/HTML files for confidentiality reasons. Thanks for your understanding.

        6,686585
        Grand MasterGrand Master
        6,686585

          20:46 - Jul 05#4

          I want to mention first that this is a user-to-user forum and I am also just a user and not an employee of UltraEdit, Inc.

          It looks like the Excel sheets do not contain many data columns. There are perhaps just one or two data columns on left side with an identifier number and/or an identifier string and there is next a data column with the text in English and one more data column with the text in another language. That is typical for translation text files as far as I know from my experience on having done text translations for applications too in the past and still doing it sometimes. It could be better saving each Excel sheet as UTF-16 LE encoded CSV file and compare the two CSV files with a text instead of a table mode comparison. Then it would be possible to toggle on the word-wrap mode and get the results written more readable into an HTML file with web browser also applying automatically a word wrap on window boundary.

          I searched on the NAS of the company I work for for an Excel file containing mainly text and found one by chance which is similar to yours. It contains also some small data columns on beginning of each row and next two data columns for text in German and in English and last two more data columns with version information and a comment. I made a copy of this Excel file and made on four rows changes on German and English text. Then I compared the two Excel files with UltraCompare Professional with table mode, enabled the viewing option to get just the different rows displayed and saved the result into an HTML file as you did too.

          I opened next the HTML file in web browser and could see the table with no word-wrap like you. I have HTML and CSS knowledge and looked like you first on the CSS section in the web browser (Firefox) using the Inspector of the Web Developer Tools. There are no width or word-wrap CSS attributes in the CSS section of the results HTML file nor are those attributes defined implicit by the web browser.

          Then I opened the HTML file in UltraEdit and looked on the text. Now I could see why no web browser wraps the text in the cells of the table. UltraCompare replaces each normal space character by the HTML entity &nbsp; for a no-break space. The web browser can wrap a text in a table cell for that reason only on finding other line wrap or word wrap characters like the hyphen character.

          If you prefer the results in a table format instead of a plain text format, I suggest opening the table results HTML file in UltraEdit and run a replace all from top of the file searching for the string &nbsp; and replacing it with a normal space character. There could be also run a Perl regular expression replace all with the find expression (?<=[A-Za-z_!,./:;])&nbsp;(?=[A-Za-z_]|&apos;|&quot;) and a normal space character as replace string for replacing most but not all no-break space by a normal space. For example, a no-break space between a number (ends usually with a digit) and a unit (begins often with an ASCII letter) is highly recommended as also multiple &nbsp; in series for getting the sequence of spaces displayed as multiple spaces in the web browser too. Save the modified table results HTML file and view it in the web browser which displays now the text in the cell columns with lots of wrapped text.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            22:03 - Jul 09#5

            Hello Mofi,
            Thank you very much for all this valuable information, I'm going to try the two solutions you outline. And I'll take a closer look at what can be done with regular expressions. It's something I've wanted to look into for a long time, but I never find the time to do it. 
            Thanks again, I'll keep you posted.