Windows 10: How to compare files with different line endings

Discus and support How to compare files with different line endings in Windows 10 Network and Sharing to solve the problem; I have two versions of a software package. These are php files so normally I compare them with the directory compare function of Winmerge. However, in... Discussion in 'Windows 10 Network and Sharing' started by WimRoffel, May 14, 2020.

  1. WimRoffel Win User

    How to compare files with different line endings


    I have two versions of a software package. These are php files so normally I compare them with the directory compare function of Winmerge. However, in this case on of the two has Windows line endings crlf and the other unix lf. So Winmerge concludes that every line is different. As far as I can see there is no option to correct this.


    So my question is whether anyone knows some software that can handle this.

    :)
     
    WimRoffel, May 14, 2020
    #1
  2. BulldogXX Win User

    I want to add a comma at the end of every line

    • Click anywhere in the first line.
    • Press the End button on your keyboard.
    • Press the comma button on your keyboard.
    • Press the downward pointing arrow on your keyboard.
    • Press the End button on your keyboard.
    • Press the comma button on your keyboard.
    • Repeat steps 4 - 6 over and over until you reach the last line.
    If adding a comma at the end of a line causes the line to wrap, adjust the number of words in the line.
     
    BulldogXX, May 14, 2020
    #2
  3. dalchina Win User
    Compare a text file containing file names with files in a folder

    Hi, can only think you'd need to create a simple script.

    First create a file containing a textual representation of just the file names in the folder.
    (That's one line using a DIR command, for example).

    Then use e.g.
    Diff Checker

    Just an idea..

    There are many option for comparing text files:
    How To Compare Two Text Files Using Notepad++
    Text Compare! - An online diff tool that can find the difference between two texts
    WinMerge - You will see the difference…


    That might work if the two files contain ordered lists, one item per line.

    If the files are for some reason radically different in format and layout, you would need to create your own search and compare script.
     
    dalchina, May 14, 2020
    #3
  4. How to compare files with different line endings

    Line by line diff (file comparison) with HTML/RTF export

    Hello everyone

    Can anyone recommend a program that can compare two text files, line by line, and output the difference (preferably character differences) to a format that can be opened in MS Word, e.g. DOC, RTF or HTML? I need a tool that will compare each line from file 1 with the same line from file 2. The differences should be highlighted or should be displayed as strike-through/underline.

    I have WinMerge on my computer, but WinMerge is trying to be clever and assumes that lines were deleted in the files, so at some point it no longer compares line n in the one file with line n in the other file.

    There are some online tools that actually work quite well, but I can only view the results on line (can't save it).

    I know I can do "compare documents" in MS Word, but even MS Word sometimes tries to be clever and starts comparing the wrong lines with each other if it hits a patch of seemingly large differences in the middle of the file. I know that if I use "compare documents" in MS Word after converting the text to a table, the accuracy improves, but it still does that be-too-clever thing.

    Thanks
    Samuel

    PS. 99% of the lines in my files have differences, ranging from one character all the way to the entire line.
     
    ugcheleuce, May 14, 2020
    #4
Thema:

How to compare files with different line endings

Loading...
  1. How to compare files with different line endings - Similar Threads - compare files different

  2. Comparing two files

    in Windows 10 Gaming
    Comparing two files: I'm trying to currently compare two documents with about 2,000 lines on both. I need the second document to have the exact same number of lines as the master one, with the same names. Placement doesn't matter, just as long as the lines sre the same and are in both documents,...
  3. Comparing two files

    in Windows 10 Software and Apps
    Comparing two files: I'm trying to currently compare two documents with about 2,000 lines on both. I need the second document to have the exact same number of lines as the master one, with the same names. Placement doesn't matter, just as long as the lines sre the same and are in both documents,...
  4. How to remove end of the file name if the end varies?

    in Windows 10 Network and Sharing
    How to remove end of the file name if the end varies?: HiI need to remove part of the file name from multiple files. File name extensions vary as does the text I want to get rid of. So is there a PowerShell script that can for example remove everything between " - " and "."?Example of what I'm after:Demo - 200704270834.jpg ->...
  5. How to remove end of the file name if the end varies?

    in Windows 10 Gaming
    How to remove end of the file name if the end varies?: HiI need to remove part of the file name from multiple files. File name extensions vary as does the text I want to get rid of. So is there a PowerShell script that can for example remove everything between " - " and "."?Example of what I'm after:Demo - 200704270834.jpg ->...
  6. How to remove end of the file name if the end varies?

    in Windows 10 Software and Apps
    How to remove end of the file name if the end varies?: HiI need to remove part of the file name from multiple files. File name extensions vary as does the text I want to get rid of. So is there a PowerShell script that can for example remove everything between " - " and "."?Example of what I'm after:Demo - 200704270834.jpg ->...
  7. How to compare directories ?

    in Windows 10 Support
    How to compare directories ?: Good morning all I would like to compare two directories to see what files are in one directory but not in the other. Is this possible in Win10 ? In case I need third party software I would like to know what is your favorite tool to do this job. Thanks Lee 178733
  8. start line - end line to output file (BAT script)

    in Windows 10 Support
    start line - end line to output file (BAT script): input.txt it is a text file with 10 lines in it one two three four five six seven eight nine ten i want to create a text file from line 3 to 7 it will be output.txt three four five six seven i want to know, how i can create a file that getting lines from another file...
  9. How to compare text files to create a new file?

    in Windows 10 Support
    How to compare text files to create a new file?: One notepad file was installed on multiple computers. When each computer was used the notepad file was updated. Text was added, removed, or modified over time to each of the files. The files are very different now for the same file name. What software is available that could...
  10. How to compare two files.

    in Windows 10 Software and Apps
    How to compare two files.: What is the best way to do a byte by bye comparison of two large files - Windows 10 64 bit. There is an FC command but when run in the Power Shell I think it wants to do a 'Format Custom'! 37671

Users found this page by searching for:

  1. compare two files to create a new file with differences