zeus
4 years ago
7 changed files with 24759 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||
echo "Inverting the pattern match" |
|||
grep -v "Jordan" $LLO_DATAFILE | head 5 |
|||
echo "Matching the lines that start with a string" |
|||
grep -n "^Mi" $LLO_DATAFILE | tail -5 |
|||
echo "Checking for the whole words in a file" |
|||
grep -w "Jordan" $LLO_DATAFILE | tail -5 |
|||
echo "Displaying only the matched pattern" |
|||
grep -o "Jordan" $LLO_DATAFILE | tail -5 |
@ -0,0 +1 @@ |
|||
grep -Hns "Jordan" $LLO_DATAFILE | grep -o Ed | head -15 |
@ -0,0 +1 @@ |
|||
grep -Hns "Jordan" $LLO_DATAFILE | grep -v Edie | head -1 |
File diff suppressed because it is too large
@ -0,0 +1,25 @@ |
|||
By default, grep matches the given string/pattern if it found as a substring in a file. |
|||
|
|||
- You can display the lines that are not matched with the specified search sting pattern using the *-v* option. |
|||
|
|||
- The *-w* option to grep makes it match only the whole words. |
|||
|
|||
- We can make the grep to display only the matched string by using the *-o* option. |
|||
|
|||
- The *^* regular expression pattern specifies the start of a line. This can be used in grep to match the lines which start with the given string or pattern. |
|||
|
|||
[INFO] |
|||
==== |
|||
|
|||
DATAFILE |
|||
|
|||
The datafile contains aggregate individual statistics for 67 NBA seasons. from basic box-score attributes such as points, assists, rebounds etc., to more advanced money-ball like features such as Value Over Replacement. |
|||
|
|||
Take a look in |
|||
link:https://git.swarmlab.io:3000/llo/LabLearningObject/src/branch/master/data/nba_statistics_glossary[Glossary^] |
|||
for a detailed column description |
|||
|
|||
ENVIRONMENT VARIABLE: LLO_DATAFILE |
|||
|
|||
==== |
|||
|
@ -0,0 +1,9 @@ |
|||
|
|||
Try to run |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep -Hns "jordan" $LLO_DATAFILE | grep -v Eddie |
|||
---- |
|||
|
|||
and see the Results! |
Loading…
Reference in new issue