zeus
4 years ago
7 changed files with 24779 additions and 0 deletions
@ -0,0 +1,15 @@ |
|||
|
|||
echo "Cutting Contents of a file on the standard output (stdout)." |
|||
echo "-----with fields-----" |
|||
|
|||
echo "" |
|||
echo "field 5" |
|||
cut -d',' -f5 $LLO_DATAFILE | head -5 |
|||
|
|||
echo "" |
|||
echo "field 8,13" |
|||
cut -d',' -f8,13 $LLO_DATAFILE | head -5 |
|||
echo "" |
|||
|
|||
echo "field 8-10" |
|||
cut -d',' -f8-10 $LLO_DATAFILE | head -5 |
@ -0,0 +1 @@ |
|||
cut -d',' -f8,13 $LLO_DATAFILE | grep "[A-Z,a-z]" | head -5 |
@ -0,0 +1,6 @@ |
|||
|
|||
-d option is used then it considered ',' as a field separator or delimiter |
|||
|
|||
grep with regex (see grep) |
|||
|
|||
|
File diff suppressed because it is too large
@ -0,0 +1,33 @@ |
|||
|
|||
*-f(field):* To extract the specific field. |
|||
|
|||
*-c* option is useful for fixed-length lines. |
|||
|
|||
Most files doesn’t have fixed-length lines. |
|||
|
|||
To extract information you need to cut by fields. |
|||
|
|||
List of the fields must be separated by -d option. |
|||
|
|||
|
|||
[source,bash] |
|||
---- |
|||
cut -d',' -f5 $LLO_DATAFILE | head -5 |
|||
---- |
|||
|
|||
|
|||
[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] |
|||
---- |
|||
cut -d',' -f8,13 $LLO_DATAFILE | grep "[A-Z,a-z]" | head -5 |
|||
---- |
|||
|
|||
and see the Results! |
Loading…
Reference in new issue