I have two large (2-3MB) text files with only a few hundred characters different. Normally diff would work fine for comparing them to find the differences. But although it's a text file, there are NO newlines at all in these files, which makes "diff" useless. The entire file is one gigantic line so even text editors hate it.
The files very frequently use : (colons) so maybe if I could insert a newline after each : character, diff might produce something meaningful. (Inserting newlines every N character isn't going to work because the lines will all be different after the first character that differs, so I think it needs to be based on some common pattern or character.)
How do use sed to do this?
:
character" – How about a newline instead of each:
character?tr
can easily do this. Can you take it from here? (2) "The entire file is one gigantic line" – Is this line properly terminated by a newline character? "NO newlines at all" suggests it's not properly terminated. So it's an incomplete line, right?