Wasted a lot of time with Filemerge insisting huge paste was one line
Wasted a lot of time trying to compare the results of two drupal_set_message print array wrapped in pre tags, copied out of the browser.
Various text editors treated it as having multiple lines (around 3,000 lines, in fact) but FileMerge insisted that it was one giant line. I tried saving, again with multiple editors, to Unix line ending type. I do use Unix-style line breaks by default ("LF") but this had no effect.
Anyone have any experience/advice on this?
FileMerge uses diff, and it doesn't work in diff either.
If I look at it in vi I see ^M^M and ^M instead of line breaks.
Resolution
Ahh: http://www.macosxhints.com/article.php?story=20001206164827794
If you see a bunch of ^M's in the file, you have Mac line breaks. There are some shell commands [editor's note - see the comments for a one-line perl command to fix your files!] that can auto-replace them, but I just used a Mac text editor (either jedit, BBedit, or Alpha) and re-saved the file, making sure to specify UNIX as the file type.
perl -pi -e 's/\r/\n/g' [filename]
That did it!
Comments
Post new comment