Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

shinji

macrumors 65816
Original poster
I have a 24 mb text file and I need to create another one that contains all the lines with a given keyword.

Is there a simple unix command to do this? Or am I better opening the whole thing in textmate and trying it that way?
 
BBEdit is probably the best application for this.

However, Excel is also a useful tool for text manipulation. (however, you are limited to working with chunks of the file that are no more than 65,000 lines long)
 
BBEdit is probably the best application for this.
However, Excel is also a useful tool for text manipulation.

I've actually been thinking about switching to BBEdit despite the silly pref pane.

Got another thread about that here: https://forums.macrumors.com/threads/460512/

But as far as this issue, there must be some way built-into the os? I'm not even sure how to search the man pages for this because it's such a broad topic and there so many commands.
 
Actually I just figured this out

grep -i "keyword" filename.txt > newfilename.txt
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.