NOTE: Notepad Sucks

Monday, July 31st, 2006 06:15 pm
flwyd: (dogcow moof!)
[personal profile] flwyd
I 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:
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.

Date: 2006-08-01 04:29 pm (UTC)
From: [identity profile] bike4fish.livejournal.com
Notepad is the "use if there is no other text editor in the entire world" text editor. It was much better when its file size was restricted and you'd get the message "File too big for Notepad. Would you like to use Wordpad instead?" At least then you couldn't get yourself in too much trouble.

I use Vim as my catch-all editor on windoze these days.

Date: 2006-08-01 09:33 pm (UTC)
From: [identity profile] mythicsagecat.livejournal.com
I replaced notepad with win32pad.
http://www.gena01.com/win32pad/
December 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2025

Most Popular Tags

Expand Cut Tags

No cut tags
Page generated Tuesday, December 30th, 2025 08:25 pm
Powered by Dreamwidth Studios