Announcement

Collapse
No announcement yet.

I need to ignore line ends

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

  • I need to ignore line ends

    I want to be able to ignore:

    white space at the end of a line and at the start of the next line, including the line ends.

    I can't seem to do this through any settings. Is it possible to do this through a "Grammar" option, or through the "Replacement" tab for Session settings?

  • #2
    If the text you are looking to align on the left is:
    ABC
    and on the right is:
    AB
    and C on the next line

    BC3 cannot ignore line breaks and align text on multiple lines like this. You would need to pre-process your data using an external conversion program that would standardize the whitespace and place the data you need to compare on the same line or individual lines:
    ABC = ABC

    or

    A
    B
    C.

    The same is true for unsorted files. An example of defining and external conversion process can be found here:
    http://www.scootersoftware.com/suppo...rnalconversion
    The additional file format XML Tidy also behaves similarly:
    http://www.scootersoftware.com/downl...oreformats_alt
    Aaron P Scooter Software

    Comment


    • #3
      Thanks for the reply Aaron.

      My main use of BC is comparing the source of web site files (php/html/css/js) and often these script and markups do not treat any white space (including line ends) as important.

      While the rationale is valid in many contexts that white space (including line ends) between two statements, or parts of statements, means that "text has 'moved' from one area of the file to another" (and therefore is to be treated as important), this is certainly not universally applicable, and does not account for a lot of real-life application in web development.

      I'll take a look at your suggestions, but is there not a grammar regex solution that will effectively treat the whole file as one line or something?

      Thanks,
      Mark

      Comment


      • #4
        Hello,

        There is no RegEx to treat the file as if it were one line, but you could create a pre-processing program that removes all line breaks. Then you would need to edit the File Format to increase the maximum length of a single line (Tools menu -> File Formats, specific format, Conversion tab, Characters per line limit.)

        For HTML, we have an HTML Tidied file format available to tidy the whitespace and line breaks. If you are familiar with any other programs for your other file types, you can plug those in to BC3 as well.

        Expanding this behavior is on our Customer Wishlist.
        Aaron P Scooter Software

        Comment

        Working...
        X