Jump to content

Archived

This topic is now archived and is closed to further replies.

mameha

how to speed up find/replace in text editor

Recommended Posts

I am often doing large find/replace commands in Notepad as I convert Excel files before putting into MySQL.  I am replacing tab characters with the | character and it is taking 5 mins per file in Notepad.

Is there another windows program that can do find/replace faster?

Share this post


Link to post
Share on other sites
winVi or vim for Windows - just be prepared to learn :)

:%s/\t/|/g

Should do the trick once you've got the file loaded.

Or, if you don't feel like learning Vim, you could always get Textpad (www.textpad.com) and do a regex search and replace on \t to |

Share this post


Link to post
Share on other sites
thanks, actually i just realised i can use the \t mark when importing via phpmyadmin instead of | and save myself a lot of time!

Share this post


Link to post
Share on other sites
[quote author=Daniel0 link=topic=111356.msg451239#msg451239 date=1160718594]
Else you could just copy a tab and paste it into the replace field.
[/quote]

The only problem with that is that tabs may be represented differently - I don't believe databases expand \t to 4 spaces or 8 spaces or whatever. I believe they just leave them as \t, and I wouldn't be surprised if the text editor in use would expand the \t to 4 or 8 spaces or whatever it thinks a tab is.

Share this post


Link to post
Share on other sites
No, but that doesn't matter. A tab is a tab, but in different editors it is presented different. Sometimes it might be 2, 4 or 8 (or user configurable), but a tab is still = \t

But it is much easier to just write \t if the editor support it.

Share this post


Link to post
Share on other sites
Basically I have since found that Wordpad does find/replace much much faster than notepad.

Also, its not necessary to find/replace anyway in this case because you can use \t as the replace character in phpmyadmin.  pasting a tab into there wont work by the way.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.