GREP – Ending With Space

The below Snippet Uses Awk and Pipes it to GREP and finds all matches that end with a space

 

awk ‘{FILELOC=”TFIDF.txt”} {print $0}’FILELOC | grep ‘^$1[[:space:]]’ D/Step2/3D_Final > a

 

so to match for a space u need to use  [[:space:]]

The snippet finds matches that start with $1 variable and proceeds with a space or a tab

You can use in any scenario , Phew took a long time to find this!! Enjoy Scripties!!

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