Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I am looking for a macintosh program that can find and replace text in a very large text file (7MB). I've tried TextMate, TextEdit and nano (command line) but both take a very long time (I've waited over an hour and still didn't finish). Am I being impatient, or is there a more efficient solution?

share|improve this question
2  
7MB doesn't seem very large to me and 1 hour does seem like a long time. Is that compressed or uncompressed? Is the find and replace just that or are you using Regular Expressions? –  AllInOne Dec 26 '12 at 18:58
2  
What is slow, the loading of the file or the search/replace operation? Using Unix commands like sed would be a good alternative for big files but if you need help here please add some examples for strings to be searched and replaced. –  patrix Dec 26 '12 at 18:58
    
As a benchmark I just used BBEdit to do a simple find and replace on a 30MB text file. Was so fast it didn't have time to draw a progress bar. This is on a 2.9 Ghz i7 iMac. –  AllInOne Dec 26 '12 at 19:00
    
The file is uncompressed, and the loading of the file search/replace operation is extremely slow. I'll try BBEdit, it looks promising! –  alexy13 Dec 26 '12 at 19:09
    
@patrix - My first thought was sed too, and then I saw the 7MB comment. 7MB is not a large file. I have 1GB+ log files floating around, and even those really aren't that large. My first thought is a poorly optimized regex. –  Fake Name Dec 26 '12 at 20:07
show 1 more comment

2 Answers 2

My question was solved by AllInOne: Download BBEdit. The time to search and replace went down from 1 hour+ to about five seconds.

share|improve this answer
add comment

I usually use Text Wrangler (the free incarnation of the full featured BBEdit) for working on text files that are too large for other tools.

share|improve this answer
    
Same thing. BBEdit is the paid version of TextWrangler with a few more features... either of them do not suck. –  donlaur Dec 26 '12 at 19:47
1  
Well, I'll be darned. Didn't know that. –  ultraloveninja Dec 26 '12 at 19:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.