NOTE: Notepad Sucks
Monday, July 31st, 2006 06:15 pmI was working with a large (12 megabyte) text file of SQL. I did a little work in vim on my Linux laptop and then copied it to a Windows machine (where SQL Server lives) so I could import the data. I decided I wanted to remove the " marks before importing the data, so I opened the file in Notepad and did a Replace All.
Any text editor or word processor in its right mind would replace all the text, place your cursor somewhere sensible (like the first or last replacement) and inform you how many times text was replaced.
Notepad is not in its right mind.
Notepad implements Replace All as (one may presume) like this:
In other words, it shows you every replacement as it does it. So what should be 5-30 seconds of text processing turns into 15-30 minutes of 100% CPU-usage GUI action. And after the screensaver turns on and you move your mouse you no longer see the GUI's activity, just a giant white box.
Never send a dunce core utility to do a plebian core utility's text processing
Update: Screw it. At least Task Manager is well written and efficient.
Update 2: Why does IE use DOS \n\r line breaks if you browse to a text file and say "Save As" but uses the source (in this case UNIX \n) line breaks if you right click on the link and say "Download." It's the same frickin' MIME type.
Any text editor or word processor in its right mind would replace all the text, place your cursor somewhere sensible (like the first or last replacement) and inform you how many times text was replaced.
Notepad is not in its right mind.
Notepad implements Replace All as (one may presume) like this:
while (-1 != pos = findTextAndScrollToResult(&text)) {
replaceTextAndDisplayNewText(&text, &replacement);
}In other words, it shows you every replacement as it does it. So what should be 5-30 seconds of text processing turns into 15-30 minutes of 100% CPU-usage GUI action. And after the screensaver turns on and you move your mouse you no longer see the GUI's activity, just a giant white box.
Never send a dunce core utility to do a plebian core utility's text processing
Update: Screw it. At least Task Manager is well written and efficient.
Update 2: Why does IE use DOS \n\r line breaks if you browse to a text file and say "Save As" but uses the source (in this case UNIX \n) line breaks if you right click on the link and say "Download." It's the same frickin' MIME type.