zeus
4 years ago
8 changed files with 24811 additions and 2 deletions
@ -1 +1 @@ |
|||
grep -i "Jordan" $LLO_DATAFILE | head -15 |
|||
grep -i "Jordan" $LLO_DATAFILE | head -5 |
|||
|
@ -1,3 +1,3 @@ |
|||
grep -c "Jordan" $LLO_DATAFILE |
|||
echo " Prefix each line of output with the 1-based line number within its input file." |
|||
grep -n "Jordan" $LLO_DATAFILE | tail -15 |
|||
grep -n "Jordan" $LLO_DATAFILE | tail -5 |
|||
|
@ -0,0 +1,10 @@ |
|||
|
|||
|
|||
grep '[Jj][oO][rR][dD][aA][nN]' $LLO_DATAFILE |
|||
|
|||
grep '\<b.t\>' $LLO_DATAFILE |
|||
|
|||
grep -E 'Michael Jordan|Eddie Jordan' $LLO_DATAFILE |
|||
|
|||
grep '199[0-9]' $LLO_DATAFILE | grep -E "Kukoc|Jordan" |
|||
|
@ -0,0 +1,2 @@ |
|||
|
|||
grep "Jordan" $LLO_DATAFILE | grep -v Edd | grep Michae | grep 199[0,1,2] |
@ -0,0 +1 @@ |
|||
echo "Try grep --help\n cat --help \n cut --help" |
File diff suppressed because it is too large
@ -0,0 +1,76 @@ |
|||
|
|||
The grep understands three different types of regular expression syntax as follows: |
|||
|
|||
- basic (BRE) |
|||
- extended (ERE) |
|||
- perl (PCRE) |
|||
|
|||
|
|||
Examples |
|||
|
|||
The dot (.) matches any single character. You can match specific characters and character ranges using [..] syntax. |
|||
|
|||
|
|||
[source,sh] |
|||
---- |
|||
grep "Jordan" $LLO_DATAFILE | grep "\,199.\,M" |
|||
---- |
|||
|
|||
INFO: You can escape the dot (.) by preceding it with a \ (backslash) |
|||
|
|||
|
|||
Say you want to Match both ‘Jordan’ or ‘jordan’: |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep '[Jj]ordan' $LLO_DATAFILE |
|||
---- |
|||
|
|||
OR |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep '[Jj][oO][rR][dD][aA][nN]' $LLO_DATAFILE |
|||
---- |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep '\<b.t\>' $LLO_DATAFILE |
|||
---- |
|||
|
|||
Where, |
|||
|
|||
- \< Match the empty string at the beginning of word |
|||
- \> Match the empty string at the end of word. |
|||
|
|||
|
|||
Do *OR* with grep |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep -E 'Michael Jordan|Eddie Jordan' $LLO_DATAFILE |
|||
---- |
|||
|
|||
Do *AND* with grep |
|||
|
|||
[source,sh] |
|||
---- |
|||
grep '199[0-9]' $LLO_DATAFILE | grep -E "Kukoc|Jordan" |
|||
---- |
|||
|
|||
|
|||
[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,28 @@ |
|||
|
|||
Try to find |
|||
|
|||
- 1995-96 Chicago Bulls Roster |
|||
- 2-Point Field Goal Percentage |
|||
- Optional: Jordans Assists |
|||
|
|||
|
|||
|
|||
[source,sh] |
|||
---- |
|||
No. Player Pos |
|||
0 Randy Brown PG |
|||
30 Jud Buechler SF |
|||
35 Jason Caffey PF |
|||
53 James Edwards C |
|||
54 Jack Haley C |
|||
9 Ron Harper PG |
|||
23 Michael Jordan SG |
|||
25 Steve Kerr PG |
|||
7 Toni Kukoč SF |
|||
13 Luc Longley C |
|||
33 Scottie Pippen SF |
|||
91 Dennis Rodman PF |
|||
22 John Salley PF |
|||
8 Dickey Simpkins PF |
|||
34 Bill Wennington C |
|||
---- |
Loading…
Reference in new issue