Filter, grep and split file in Linux

Filter only file MM* that contain 20111201

egrep -h “\|20111201\|” MM* > file_1

Split file, each file will contain 500000

split -l 50000 file_1 MM_20111201_000000000

Skip any line that start with FH

egrep -v “^FH\|” MM_20111203_000000000_XX.aa > abc

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: